You'll have to read all of your data and store it. It looks like what you're asking for requires a multi dimensional array. If not, well I'll provide an example for a tile system. Using a 2D array so that you can access rows and colums of data.
Here's an example of how you might do that:
map_height = 4
map_width = 4
dim map(map_width,map_height) as integer : ` 2D array to hold the tile data
` read and store tiles in a 2D array
for tile_y = 1 TO map_height
for tile_x = 1 to map_width
read map(tile_x,tile_y)
next tile_x
next tile_y
print map(3,3)
repeat
until scancode()<>0
` map tile data
data 0,0,0,0
data 0,0,0,0
data 0,0,1,0
data 0,0,0,0
Now if you wanted to display the third tile over and the third tile down is then you would check map(3,3) and see that it's holding a 1.
It is possible to do what you requested, IF you use the restore command. Though, it's not a very efficient method of reading and accessing your data. Data statements are linear. You read them from beginning to end. Say you had a data statement that contained 10 items (ie. data 1,2,3,4,5,6,7,8,9,0). Now, you can't read 10th item without reading the first 9. Data statements don't work that way. However, if you read all 10 and you want to go back and read the 5th item, you can do that if you use the restore command and you read the first 5 items all over again. Not a very effective method at all. This is why you would store the data in an array.
Quote: " Timesoft - Your wife is death. How? NO idea.
But it is murder. REVENGE!!!!!!!!!"
Hands down the funniest synopsis for a game ever. All your base are belong to us!