how to get next object in a list

BlitzMax Forums/BlitzMax Beginners Area/how to get next object in a list

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

From the user help:

'Author:Assari
'FirstLink(), Value() and NextLink()
'Note that Value() and NextLink Methods from Type TLink
'Whereas FirstLink() is a method from Type TList
SuperStrict

Local MyList:TList = CreateList() 
MyList.AddFirst("A")
MyList.AddFirst("B")
MyList.AddFirst("C")

Local NLink:TLink = MyList.FirstLink() 'get first Link
Repeat
   Print NLink.Value().ToString() 'Need to convert value from object to string
   NLink = NLink.NextLink()       'Move to the next link in list
Until Nlink = Null                'Null means we've reached the end of the list

================
Output
C
B
A