Hm... surely, you wouldn't need to reset
all variables, right?
For arrays, you could just re-declare them like so
undim arrayName(0) ` must be zero as index
dim arrayName(a, b, c) as arrayType ` However it now looks in your default declaration
For objects / sprites etc. you could write a function like this
function destroyAll(start as dword, stop as dword)
for i = start to stop
if object exist(i) then delete object i
if sprite exist(i) then delete sprite i
if image exist(i) then delete image 1
if sound exist(i) then delete sound i
if mesh exist(i) then delete mesh i
....
next i
endfunction
When giving this a range like 1 through 131070 it would perhaps take a while, but still it's much better than restarting the program. Then just go back to the beginning of your code, right after the declarations.
(The removal function of course expects that you don't (like me ':b) store objects / other things in chunks like grass objects start at 100 000, decals at 150 000 and so on, or you'd have to loop through a great many instances).
"I kören hörs de brummande busarna Björnligan och Gondolen"