Restoring Data with a variable

Blitz3D Forums/Blitz3D Beginners Area/Restoring Data with a variable

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If the speed is a critical issue, you can load all the levels data in a 2D array at the starting of the program; later, read the values for a level from the array itself.

Suppose you have 1000 values to be red for each level, and 100 levels.

Then you can dimension an array like
CONST terminator = -999 ;level data terminator
dim level(100,1000)
;fill the array with level data, and terminator
read_all_the_levels_data_into_the_array()

;and read the values for the level number 'L' with this:
for n = 1 to 1000
generic_value = level(L,n)
if generic_value = terminator then
exit
endif
next


Sergio.