Data statements
BlitzMax Forums/BlitzMax Beginners Area/Data statements
| ||
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! :) |
| ||
You haven't got a call to `Graphics()` so how can you be using DrawText and Cls anyway? |
| ||
ReadData arse[plop] |
| ||
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 |
| ||
reading the help sometimes helps... So does reading previous posts... |
| ||
. |
| ||
not really as you don't have a restoredata in as the original source |
| ||
It's not needed in this case. |
| ||
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. :) |
| ||
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. |