How to use DATA command in Blitz Max?

BlitzMax Forums/BlitzMax Beginners Area/How to use DATA command in Blitz Max?

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.

lobal player_list:TList=CreateList() 'To Store all the players

Type player
	Field name$

	Function create(_name$)
		Local p:player 	= New player
		      p.name$	= _name$
		ListAddLast player_list, p
	End Function	
End Type


RestoreData lbl_names

Repeat
	Local Name:String 
	ReadData name
	If name = "end" Then Exit
	Player.Create(name)
Forever

For Local P:Player = EachIn Player_List
	Print p.name
Next

' Example data, this won't work in Blitz Max;
#lbl_names
DefData "Smith"
DefData "John"
DefData "Bob"
DefData "end" ' This is a marker saying its reached the end of all the names


This should work.
Info:
Data statement has changed to DefData
the label indicator has changed to #