I broke down the code to only the skeleton and the erroneous parts, since I can't post the entire code.
#include "functions.dba"
function main_game()
gosub init
while error=0
gosub take_input
gosub update
endwhile
init:
rem Set resolution
set_resolution()
rem Make lots of object...
return
take_input:
rem take input
return
update:
rem move objects
return
endfunction
and this code is in the file functions.dba:
rem Function
function set_resolution
if file exist("resolution.cfg")
open to read 1,"resolution.cfg"
read file 1,x
read file 1,y
read file 1,d
set display mode x,y,d
close file 1
else
open to write 1,"reolution.cfg"
write file 1,640
write file 1,480
write file 1, 16
close file 1
endif
endfunction
I recently tried this code on another computer, and it worked there, so I guess it's only my version...
I didn't steal it!