Lists

BlitzMax Forums/BlitzMax Beginners Area/Lists

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.

MyList.First() returns an object, not a link, you need to use FirstLink() instead:

Type MyType
	Field Value:Int
End Type

Local MyList:TList = CreateList()
Local MyStuff:MyType

For x = 1 To 5
	MyStuff= New MyType
	MyStuff.Value=x
	ListAddLast MyList,MyStuff
Next

FirstLink:TLink = MyList.FirstLink()

If TLink(FirstLink) Then 
	Print MyType(FirstLink.Value()).value
EndIf

NextLink:TLink = FirstLink.NextLink()

If TLink(NextLink) Then 
	Print MyType(NextLink.Value()).Value
EndIf