 PROGRAM ListProcessing

   Use ListModule

   type( ListElem ), pointer :: head
   type( ListElem ), pointer :: newElem
   integer, parameter :: N = 4

   NULLIFY( head )   ! Empty list

   ! ---------------------------------------------         
   ! Add the N elements
   ! ---------------------------------------------
   DO i = 1, N
     ALLOCATE( newElem )

     CALL random_number( newElem%value )

     head => InsertList(head, newElem)
     CALL PrintList(head)
   END DO

  head => DeleteList(head)

END PROGRAM 
