Tlist fails :/

BlitzMax Forums/BlitzMax Beginners Area/Tlist fails :/

Wings(Posted 2013) [#1]
'This code fails. it says "Unhandled exception: Attempt to access field or method of Null object.
'Please give advice as this halt my bigger Project. i just want a type to Point to Another type as in Blitz 3d

Global b:bone

Type bone
Field x:Int
Field b:bone
End Type
Global bonelist:TList

b:bone = New bone
b.b = b


ListAddLast bonelist,b


GfK(Posted 2013) [#2]
It's not failing, per se. You just aren't doing it right.
Global bonelist:TList = New TList


Oh, and whatever that b.b = b stuff is about, you're setting yourself up for cyclic reference hell.


Wings(Posted 2013) [#3]
Ty iam getting tired :D


Wings(Posted 2013) [#4]
the b.b = b was an atept to fill out the null object pointer. (In desperation)