Accessing a field of an object from a Linked List

BlitzMax Forums/BlitzMax Beginners Area/Accessing a field of an object from a Linked List

McFox(Posted 2005) [#1]
Ok here is the code :

Global List:TList = CreateList()
Type mytype
	Field test:Int
EndType
test1:mytype = New mytype
test1.test = 2
ListAddLast list,test1
Print ListFindLink(list,test1).Value.test

The probleme is at the last line, is there a way to access the field test of the mytype tye test1 from the list called list ?

Thanks in advance

McFox


Bot Builder(Posted 2005) [#2]
Print mytype(list.Last()).test

or

Print mytype(list.LastLink().Value()).test