What you do is you use the DATA command to define some data, i.e.
REM Some Data Numbers
DATA 1
DATA 2
DATA 3
DATA 5
Then, you use the READ command to see what you have, i.e.
REM Some Data Numbers
DATA 1
DATA 2
DATA 3
DATA 5
REM The Array I'm going to fill with the numbers
DIM reads(4)
REM Read the data
FOR i = 1 to 4
READ int
reads(i) = int
PRINT int
NEXT i
This little snippet will first define some data, then make an array to put it in, and finally read that data and put it into the array.
You can also have multiple bits of information on each DATA command. This snippet has to do with contact information:
REM Contacts
DATA "Bob","Jones","12345 Main St.",25
DATA "Jane","Doe","7645 Side Blvd.",34
REM Contact Array
DIM contacts$(2,4)
REM Read the data and put it in the array
FOR i = 1 to 2
READ Name$,Last$,Address$,Age
contacts$(i,1) = Name$
contacts$(i,2) = Last$
contacts$(i,3) = Address$
contacts$(i,4) = STR$(Age)
NEXT i
I think that you can figure that one out for yourself.
Finally, you can use the RESTORE command to go to a label to read from data from there, rather than from the first DATA command. i.e.
REM Aliens
Aliens:
DATA "Bob",3
DATA "Joesnicker",7
DATA "Blargfen",1
REM Monsters
Monsters:
DATA "Freddy",3
DATA "Jiminy",9
DATA "Sam",11
REM Read the data
RESTORE Monsters
PRINT "MONSTERS"
FOR i = 1 to 3
READ Name$,Attack
PRINT "Name: "+name$+". Attack: "+attack
NEXT i
RESTORE Aliens
PRINT "ALIENS"
FOR i = 1 to 3
READ Name$,Attack
PRINT "Name: "+Name$+". Attack: "+attack
NEXT i
The DATA command can be used for information such as stats or levels, because you can easily compact it into easy blocks, then go to the one you need, as an alternate to opening separate files.
Hope that helped!
~QJ
That's what they WANT you to think...