The problem is that you need to check if the link provided by FindLink() exists or not.
edit - simple example (I hope...)
Try to change FindLink(myobj[1]) with FindLink(myobj[11]) - this link doesn't exist - but you catch the possible error
edit - simple example (I hope...)
Local the_list:TList = New TList Type obj Field value$ End Type Local myobj:obj[20] For i = 1 To 10 myobj[i - 1] = New obj myobj[i - 1].value="Hallo "+String(i) the_list.addlast myobj[i - 1] Next For Local iaa:obj = EachIn the_list Print iaa.value Next Local link:TLink = the_List.FindLink(myobj[1]) Local newLink:TLink If link Print "Link exists "+obj(link.value()).value newlink = link.NextLink() Print "<"+obj(newlink.value()).value+">" Else Print "Link doesn't exist" End If
Try to change FindLink(myobj[1]) with FindLink(myobj[11]) - this link doesn't exist - but you catch the possible error