Linked Lists - How to get first/last items(?)
BlitzMax Forums/BlitzMax Beginners Area/Linked Lists - How to get first/last items(?)
| ||
How do I get the first or last item from a linked list? Here's an example where I want the first item: list:TList=CreateList() Type test Field x End Type t:test=New test t.x=123 ListAddLast list,t t:test=New test t.x=456 ListAddLast list,t ' ?????? 't:test=list.FirstLink() 't:test=list.First() Print t.xAgain, what about if I want the last item where t might be pointing elsewhere. What I'm after is similar methods to Blitz3D's First/Last. |
| ||
.first is the command you have to convert to test t:test=test(list.First()) |
| ||
Thankyou. |