Data statements

BlitzMax Forums/BlitzMax Beginners Area/Data statements

(tu) ENAY(Posted 2005) [#1]
ARRGGHH!! I can't seem to figure out how to use labels.
What am I doing wrong?

Strict

Global arse:Int [3]

For Local plop:Int=0 To 2
	arse[plop] = ReadData Moo
Next 

#Moo

DefData 4
DefData 6
DefData 11

Repeat

Cls

DrawText arse[0],0,0
DrawText arse[1],0,15
DrawText arse[2],0,30
Flip
FlushMem

Until KeyHit(KEY_ESCAPE)

End


Ta! :)


ImaginaryHuman(Posted 2005) [#2]
You haven't got a call to `Graphics()` so how can you be using DrawText and Cls anyway?


Yan(Posted 2005) [#3]
ReadData arse[plop]



Dreamora(Posted 2005) [#4]
reading the help sometimes helps ...

Strict

Global arse:Int [3]

RestoreData Moo
For Local plop:Int=0 To 2
	ReadData arse[plop] 
Next 

Graphics 800,600,0

Repeat

Cls

DrawText arse[0],0,0
DrawText arse[1],0,15
DrawText arse[2],0,30
Flip
FlushMem

Until KeyHit(KEY_ESCAPE)

End

#Moo

DefData 4
DefData 6
DefData 11



Yan(Posted 2005) [#5]
reading the help sometimes helps...

So does reading previous posts...


Yan(Posted 2005) [#6]
.


Dreamora(Posted 2005) [#7]
not really as you don't have a restoredata in as the original source


Yan(Posted 2005) [#8]
It's not needed in this case.


(tu) ENAY(Posted 2005) [#9]
Well I just typed that code off the top of my head so someone could understand roughly what I was trying to get at. I looked through all after the help files and there are no examples of using labels.

Anyway, cheers guys. I'll give what you gave me a whirl. :)


ImaginaryHuman(Posted 2005) [#10]
Usually "restore" tells it what label you want to start reading from, while "readdata" should read the next piece of data into the variables you specify.