PrevLink() & NextLink()

BlitzMax Forums/BlitzMax Programming/PrevLink() & NextLink()

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.

Am I missing something?

Strict

Type test
    Field a:Int
    Field b:Int
    Field c:Int
End Type

Local list:TList = New TList

For Local i:Int=1 To 10
    Local t:test = New test
    t.a = i
    t.b = i
    t.c = i
    list.AddLast(t)
Next

For Local t:test=EachIn list
	If t.a = 5
		Local link:TLink = list.FindLink(t)
		
		If link.NextLink()
			Local nextt:test = test(link.NextLink().Value())
			    
			nextt.b = 200
			nextt.c = 300
		EndIf
	EndIf
Next

For Local t:test=EachIn list
    Print t.a
    Print t.b
    Print t.c
    Print
Next

Or

Strict

Type test
	Field link:TLink
	
	Field a:Int
	Field b:Int
	Field c:Int
End Type

Local list:TList = New TList

For Local i:Int=1 To 10
	Local t:test = New test
	t.a = i
	t.b = i
	t.c = i
	t.link = list.AddLast(t)
Next

For Local t:test=EachIn list
	If t.a = 5
		If t.link.NextLink()
			Local nextt:test = test(t.link.NextLink().Value())
			
			nextt.b = 200
			nextt.c = 300
		EndIf
	EndIf
Next

For Local t:test=EachIn list
	Print t.a
	Print t.b
	Print t.c
	Print
Next