im tring to save to a file
but i get no file
how do i create the file ?
here is my code:
fileX=OPENFILE(1,pathtofile, 1)
WRITEBYTE 1,maingamescore
CLOSEFILE 1
you want to save a score?
You know the INIOPEN command?
This is how to open a file for writing:
LOCAL ok // status value from fileopen
LOCAL filenr // the id number of this file when it's open
LOCAL value% // The byte to write to the file
filenr = GENFILE() // Get a free ID-number
ok = OPENFILE(filenr, "filename.ext", 0) // 0 = Open the file for write
IF ok = TRUE
WRITEBYTE filenr, value% // writes a byte to the file (value can only be 0 - 255)
WRITESTR filenr, "Hello" // Writes a string, not terminated by carriage return or line-break
CLOSEFILE filenr
ENDIF