Local player:TPlayer = players:TList.Last:TPlayer?

BlitzMax Forums/BlitzMax Programming/Local player:TPlayer = players:TList.Last:TPlayer?

Trader3564(Posted 2008) [#1]
Ye, sorry about the title.

Im having troubles reading 1 item (a TPlayer) from a TList.

Local player:TPlayer = players:TList.Last:TPlayer
Gives errors, and i tried many variations.

Only in a loop using EachIn, i can get it working.
How do i get a single item from the list as type TPlayer?


GfK(Posted 2008) [#2]
Tried Local player:TPlayer = TPlayer(players.last()) ??

or...

Local player:TPlayer = TPlayer(players.ValueAtIndex(N)) ??


Trader3564(Posted 2008) [#3]
ok. works. i forgot todo add ()

so earlier i wrote: last instead of last()

thanks.