EndOfList
State = EndOfList(List())
 
Parameters:

    List() = The Type list handle you wish to query
Returns:

    State = The state of the current list index (1=end of list, 0 = not at end)
 

      The EndOfList() function queries if the current list index has been moved to the end of list.

      EndOfList returns True(1) when the end of list has been reached, otherwise it returns False(0)




FACTS:


      * Don't know what a linked list is ?, make sure you read the LinkedLists tutorial then.





Mini Tutorial:


      This example creates a list of three people, then runs through the list manually and displays each persons names and their list position.

  
; Declare the "Person" user defined type.
  Type Person
   ; These Fields will hold this persons name
     FirstName$
     SurName$
  EndType
  
;  Dimension the Friends variable of type Person,
; with linked list support
  Dim  Friends As Person List
  
  
; Add a person (Billy) to Friends list
  Friends= New Person
  Friends.FirstName$ ="Billy"
  Friends.Surname$ ="Citizen"
  
  
; Add another person (Sally) to Friends list
  Friends= New Person
  Friends.FirstName$      ="Sally"
  Friends.Surname$           ="Stevens"
  
; Add another person (Sally) to Friends list
  Friends= New Person
  Friends.FirstName$      ="Olivia"
  Friends.Surname$           ="Dude"
  
  
  
; Reset the List current index of this list ot the FIRST
; in the list
  ResetList Friends()
  
;Enter a while loop, but only while the current list position
; ifn't at the end of the list
  While Not EndOfList(Friends())
     
   ; Display this persons name
     Print Friends.FirstName$+" "+Friends.Surname$
     Print ""
     
   ; Move the current list pointer to the next link
   ; in the list.
     StepList Friends()
     
  EndWhile
  
; display the screen and wait for a key press
  Sync
  WaitKey
  
  




This example would output.

  
  Olivia Dude
  
  Sally Stevens
  
  Billy Citizen
  
  

 
Related Info: Each | GetListPos | LinkedLists | List | NewList | StepList :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com