List.AddLast() and List.AddFirst() Different?

BlitzMax Forums/BlitzMax Programming/List.AddLast() and List.AddFirst() Different?

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.

So your just moving an object from one list to another?

Yep, pretty much.

You are not saving a TLINK somewhere and using it later are you?

Well I'm keeping the TLink that is return'ed when the object is added to the list. There's no other way to remove it.

I think if you add to or remove from a TLIST, all TLINKS become invalid.

That surely can't be. I've been using TLists for years, and I've never found that to be true. Are you saying that If I do this :

Global List:TList=New TList
Type Thingy
   Field Link:TLink
End Type
Local A:Thingy=New Thingy
A.Link=List.AddLast(A)
Local B:Thingy=New Thingy
B.Link=List.AddLast(B)


Then A.Link is already invalid because I added B later? If that was the case, there would be no point in AddLast and AddFirst even returning a TLink.