home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / SHMOD10.LHA / ShowModule / Modules / Pmodules / Plist / p_CountNodes.e < prev    next >
Encoding:
Text File  |  1994-05-27  |  547 b   |  17 lines

  1. PROC p_CountNodes(list:PTR TO lh) /*"p_CountNodes(list:PTR TO lh)"*/
  2. /*===============================================================================
  3.  = Para         : address of a list
  4.  = Return       : number of nodes in the list.
  5.  = Description  : count nodes in the list.
  6.  ==============================================================================*/
  7.     DEF count=0
  8.     DEF e_node:PTR TO ln
  9.     e_node:=list.head
  10.     WHILE e_node
  11.         IF e_node.succ<>0 THEN INC count
  12.         e_node:=e_node.succ
  13.     ENDWHILE
  14.     RETURN count
  15. ENDPROC
  16.  
  17.