Passing variables into the RESTORE command

Blitz3D Forums/Blitz3D Beginners Area/Passing variables into the RESTORE command

and when i call the level i do:
currentlevel$ = "level1"
Build_Level(currentlevel$)



BTW, here are some tips:
First of all, Integers are processed much faster than Strings so it would be better to change your currentlevel$ variable to just currentlevel (an integer variable) and then just assign it a value of 1 instead of the string "level1". This speeds up the process of assigning the currentlevel variable AND it speeds up the process of passing it as a parameter in your function.

Secondly, if you are not reusing the currentlevel variable elsewhere in your code, then don't bother assigning it a value (this takes time too). Just call your Build_Level function directly (i.e. Build_Level(1) )


Some may say that I'm wasting my time optimizing code that's infrequently executed, but there's no harm in forming a habit of thinking this way.