OpenFile
Opens a file for reading and writing.
Parameters
- filename$
- the file to open.
Description
Opens an existing file for both reading and writing, and gives back its handle, or 0 if it can't. Reading and writing start at the beginning; use SeekFile to move about. Writing replaces bytes where it is, rather than inserting them.
In ArcBasic
In a game made with Create Executable, the files your program writes go in the player's own data folder, not next to the game:
~/Library/Application Support/ArcBasic Games/<game> on a Mac and %APPDATA%\ArcBasic Games\<game> on Windows.
Games are often installed where they can't write, and this keeps saves working there. You don't need to change anything: use the same file names as always, and reading looks in that folder first.
SystemProperty("savedir") tells you where it is.
When you run the program from the editor, files are written next to it, as usual.
Opening a file that came with the game changes the player's own copy of it, in that data folder. The original inside the game is never changed.
