Data is useful for when you have "hard" data; data that you write into the program to begin with.
Say for instance you had a game where there were many different types of monster that all had different attributes, you could put all the attributes and the names of the monsters in data statements like this...
...
Monsters:
REM name,strength,speed,agility,defence
data "Raghorn",82,76,45,90
data "Beemoth",59,94,99,16
data "Yugoga",99,60,80,22
data "Limadon",85,83,94,88
This is like an archive of monster templates that we'll use when spawning a monster...
dim monster(8,4)
dim monster$(8)
for n= 1 to 8
restore monsters :`puts the data cursor at the monsters label
num= rnd(3)+1 :`gives 1 to 4
for pass= 1 to num
read monster$(n)
for stat= 1 to 4
read monster(n,stat)
next stat
next pass
next n
rem print monster details
for n= 1 to 8
cls
print "Monster "; n; ":"
print monster$(n)
for stat= 1 to 4
print monster(n,stat)
next stat
next n
The Universe has been erased by a mod because it was larger
than 240x80 pixels.