GetListSize
CurrentPos = GetListSize(List())
 
Parameters:

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

    CurrentPos = The current position index the list is pointing at
 

      The GetListSize() function counts the number of used items in a linked list.



FACTS:


      * GetListSize needs to iterates the items in the list. So can be slow on large lists.

      * 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 simply displays the list size using the GetListSize function.

  
; 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"
  
  
; Display this number of items in this list.
  Print "List Size="+Str$(GetListSize(Friends()))
  
  
; display the screen and wait for a key press
  Sync
  WaitKey
  
  
  




This example would output.

  
  List Size=3
  

 
Related Info: Dim | Each | EndOfList | GetListFirst | GetListNext | GetListPos | GetListPrevious | LinkedLists | List | ResetList | SetListPos | StepList :
 


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