ill tell you what ill write a little tutorial. try running this and see if it works.
first you have to make an array
`make the array
dim ArrayName$(10,2)
The Array can be any type of variable defined by the symbol at the end of the name ($=holds Strings,#=holds real numbers,nothing=holds integers)
the number(s) in the brackets at the end tell DB how big to make the array. e.g. think of an array as lots of storage boxes. within each box are more boxes and in each of these boxes, more boxes etc. the first number is the number of original boxes, the second number the number of boxes within each original box and so on.
next, you need to tell DB what to store in the array. you do this like you would with a normal variable e.g.
ArrayName$(1,1)="hallo"
ArrayName$(1,2)="world"
the numbers in the brackets tell DBP which "box" to store the data in.
so your code should now look something like this:
`make the array
dim ArrayName$(10,2)
`fill the array
ArrayName(1,1)="Hallo"
ArrayName(1,2)="World"
ArrayName(2,1)="Hallo"
ArrayName(2,2)="Everyone"
ArrayName(3,1)="Goodbye"
ArrayName(3,2)="world"
ArrayName(4,1)="Goodbye"
ArrayName(4,2)="Everyone"
ArrayName(5,1)="A"
ArrayName(5,2)="Name"
ArrayName(6,1)="Another"
ArrayName(6,2)="Name"
ArrayName(7,1)="Third"
ArrayName(7,2)="Name"
ArrayName(8,1)="Fourth"
ArrayName(8,2)="Name"
ArrayName(9,1)="Yet Another"
ArrayName(9,2)="Name"
ArrayName(10,1)="Finally! the very"
ArrayName(10,2)="last name"
now to get it out, all you need to do is use it like a normal variable e.g.
if you were printing a whole array you should use for/next loop(s)
so now your code looks like this
`make the array
dim ArrayName$(10,2)
`fill the array
ArrayName(1,1)="Hallo"
ArrayName(1,2)="World"
ArrayName(2,1)="Hallo"
ArrayName(2,2)="Everyone"
ArrayName(3,1)="Goodbye"
ArrayName(3,2)="world"
ArrayName(4,1)="Goodbye"
ArrayName(4,2)="Everyone"
ArrayName(5,1)="A"
ArrayName(5,2)="Name"
ArrayName(6,1)="Another"
ArrayName(6,2)="Name"
ArrayName(7,1)="Third"
ArrayName(7,2)="Name"
ArrayName(8,1)="Fourth"
ArrayName(8,2)="Name"
ArrayName(9,1)="Yet Another"
ArrayName(9,2)="Name"
ArrayName(10,1)="Finally! the very"
ArrayName(10,2)="last name"
` print the array to screen
for a=1 to 10
for b=1 to 2
print ArrayName$(a,b)
next b
next a
to write it to a file, you should just use a write command:
open to write 1,"filename"
for a=1 to 10
for b=1 to 2
write string ArrayName$(a,b)
next b
next a
your finalised code should look something like this
` make the array
dim ArrayName$(10,2)
`fill the array
ArrayName(1,1)="Hallo"
ArrayName(1,2)="World"
ArrayName(2,1)="Hallo"
ArrayName(2,2)="Everyone"
ArrayName(3,1)="Goodbye"
ArrayName(3,2)="world"
ArrayName(4,1)="Goodbye"
ArrayName(4,2)="Everyone"
ArrayName(5,1)="A"
ArrayName(5,2)="Name"
ArrayName(6,1)="Another"
ArrayName(6,2)="Name"
ArrayName(7,1)="Third"
ArrayName(7,2)="Name"
ArrayName(8,1)="Fourth"
ArrayName(8,2)="Name"
ArrayName(9,1)="Yet Another"
ArrayName(9,2)="Name"
ArrayName(10,1)="Finally! the very"
ArrayName(10,2)="last name"
`print the array to the screen
for a=1 to 10
for b=1 to 2
print ArrayName$(a,b)
next b
next a
`write the array to a file
open to write 1,"filename"
for a=1 to 10
for b=1 to 2
write string ArrayName$(a,b)
next b
next a
it is probably worth noting that an undefined(empty) "box" will be returned as an empty string or 0