sandmann999
Programmer
Can someone tell me how to access a certain piece of a DATA string?
For example, if I use the lines
RESTORE TEST
FOR Y = 1 TO 10
FOR X = 1 TO 10
READ INFO
PRINT INFO
NEXT
NEXT
TEST:
DATA 1,2,3,4,5
DATA 2,2,3,1,5
DATA 1,5,8,4,1
DATA 6,3,3,0,5
DATA 1,2,3,4,2
This code would access the data starting from the top left and read down to the bottom right.
What if I wanted to jump to the middle?
Like if I wanted these four variables:
DATA 1,2,3,4,5
DATA 2,2,3,1,5
____
DATA 1,5,|8,4|,1
DATA 6,3,|3,0|,5
-----
DATA 1,2,3,4,2
How would I just jump straight through the rest of the DATA to right there?
Any help would be great.
PS: I have a rather large DATA statement that can't really be broken up into smaller parts. If I were to put RESTORE statements to access the pieces I need, there are so many options, it would take hundreds of RESTORE statements.
It's about a 100 x 100 cube of data so just even cycling through the numbers to get the ones I want takes a while. I need a way to "skip" to where I want and access it that way.
Thanks!
For example, if I use the lines
RESTORE TEST
FOR Y = 1 TO 10
FOR X = 1 TO 10
READ INFO
PRINT INFO
NEXT
NEXT
TEST:
DATA 1,2,3,4,5
DATA 2,2,3,1,5
DATA 1,5,8,4,1
DATA 6,3,3,0,5
DATA 1,2,3,4,2
This code would access the data starting from the top left and read down to the bottom right.
What if I wanted to jump to the middle?
Like if I wanted these four variables:
DATA 1,2,3,4,5
DATA 2,2,3,1,5
____
DATA 1,5,|8,4|,1
DATA 6,3,|3,0|,5
-----
DATA 1,2,3,4,2
How would I just jump straight through the rest of the DATA to right there?
Any help would be great.
PS: I have a rather large DATA statement that can't really be broken up into smaller parts. If I were to put RESTORE statements to access the pieces I need, there are so many options, it would take hundreds of RESTORE statements.
It's about a 100 x 100 cube of data so just even cycling through the numbers to get the ones I want takes a while. I need a way to "skip" to where I want and access it that way.
Thanks!