Hello,
If you use a 2 dimensional array, for example, you can assign any car a set of tracks that it can run on.
carnum=5
tracknum=5
dim carselect(carnum,tracknum)
for car=1 to carnum
for track=1 to tracknum
read carselect(car,track)
next track
next car
remstart
each data line contains five numbers. Each line represents
each car and the five numbers represent the tracks that can
be assigned to the car. If there is a zero,
no track is available
remend
data 1,2,3,4,5
data 0,2,0,0,0
data 1,2,3,0,0
data 0,0,0,4,5
data 1,0,0,0,5
Ok, when a menu item is chosen for the carnum, that variable is carried over to the first index of the array. Run a check for the number of tracks on the second index to get back the tracks the car can drive on:
rem let's say car number 3 was selected from the menu
carnum=3
for tracknum=1 to 5
if carselect(carnum,tracknum) > 0
print "Available tracks for car ";carnum;" is ";carselect(carnum,tracknum)
endif
next track
Enjoy your day.