this little snippet allows you to keep a logfile for your games:
function write_to_log(line_number,text$)
if file exist("LOG.TMP")=1 then delete file "LOG.TMP"
if file exist("LOG.TXT")=1
copy file "LOG.TXT","LOG.TMP"
delete file "LOG.TXT"
open to write 1,"LOG.TXT"
write string 1,""
write fileblock 1,"LOG.TMP"
delete file "LOG.TMP"
else
open to write 1,"LOG.TXT"
endif
write string 1,"["+str$(line_number)+"]"+GET DATE$()+"|"+text$
close file 1
endfunction
Its useful for big games, helping people who has problems, example:
write_to_log(5,"Setting Display Mode")
write_to_log(20,"Loading 3D objects")
The reason I made this, is because open to write only works if the file DOESNT exist. This makes a temporary file that gets deleted. Have fun!
Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb"