Iterating through a linked list

BlitzMax Forums/BlitzMax Beginners Area/Iterating through a linked list

EOF(Posted 2005) [#1]
I'm trying to iterate through a linked list without using EachIn:
Global lst:TList=New TList
Global tl:TLink

lst.addlast "i"
lst.addlast "hate"
lst.addlast "crazy"
lst.addlast "frog!"

tl=lst.firstlink()

While tl<>Null
	Print String(tl.value)
	tl=tl.nextlink()
Wend
What I'm not clear about is how to retrieve the string contained in each entry. Any solutions?


tonyg(Posted 2005) [#2]
Does THIS help?


Sarge(Posted 2005) [#3]
Just one little fix in your code,

Print String(tl.value())



EOF(Posted 2005) [#4]
Thanks Sarge. I almost had it.