List problem

BlitzMax Forums/BlitzMax Programming/List problem

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Think you need to cast the return to player.
e.g. P:player=player(player_list.first())
but you could post the error you're getting or the code you're using to help.
Local player_list:TList = CreateList()
Type TPlayer
	Field num:Int
End Type
For Local x:Int = 1 To 10
	temp:TPlayer = New TPlayer
	temp.num = x
	ListAddLast player_list , temp
Next
Local first_player:TPlayer = TPlayer(player_list.first())
Print first_player.num
Local last_player:TPlayer = TPlayer(player_list.last())
Print last_player.num