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

  1. PROC p_GetNumNode(ptr_list:PTR TO lh,adr_node) /*"p_GetNumNode(ptr_list:PTR TO lh,adr_node)"*/
  2. /*===============================================================================
  3.  = Para         : Address of a list,address of a node.
  4.  = Return       : The number of the node,else -1.
  5.  = Description  : Find the num of a node.
  6.  ==============================================================================*/
  7.     DEF g_node:PTR TO ln
  8.     DEF count=0
  9.     g_node:=ptr_list.head
  10.     WHILE g_node
  11.         IF g_node=adr_node THEN RETURN count
  12.         INC count
  13.         g_node:=g_node.succ
  14.     ENDWHILE
  15.     RETURN -1
  16. ENDPROC
  17.  
  18.