Insert Before/After

BlitzMax Forums/BlitzMax Beginners Area/Insert Before/After

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.

quick example:
Function InsertAfter(list:TList,a:Object,b:Object)
    list.InsertAfterLink(b,list.FindLink(a))
End Function

Function InsertBefore(list:TList,a:Object,b:Object)
    list.InsertBeforeLink(b,list.FindLink(a))
End Function


' example

Local t:TList=New TList
t.AddLast "Hello"
t.AddLast "world"

InsertAfter t,"Hello","my"
InsertBefore t,"world","magic"

For Local a$=EachIn t
Print a$
Next