TLists

BlitzMax Forums/BlitzMax Programming/TLists

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Have you been fiddeling around with the internal structures of the linked list? Because that works:
Global object_list:TList = CreateList()

o1:TTest = New TTest
object_list.AddLast o1

o2:TTest = New TTest
object_list.AddLast o2

o3:TTest = New TTest
object_list.AddLast o3

For o:TTest = EachIn object_list
	Print "Obj: " + o.ToString()
Next

o1.Destroy()
o2.Destroy()
o3.Destroy()

For o:TTest = EachIn object_list
	Notify "Obj: " + o.ToString()
Next

Type TTest
	Method Destroy()			
		object_list.Remove(Self)
		If object_list.contains(Self) Then Notify "Gah"
	End Method
EndType


'Contains(val:Object)' traverses all TLinks within the linked list and returns True when the value of one of them matches 'val'.

-- Byteemoz