- This wiki is out of date, use the continuation of this wiki instead
Save
From FenixWiki
Contents |
[edit] Definition
INT save ( <STRING filename> , <VARSPACE data> )
Saves the data from the specified variable to the specified file.
[edit] Parameters
STRING filename | - The name of the file that will be saved. |
VARSPACE data | - The variable (of any datatype) that will be saved in a file. |
[edit] Returns
INT : The number of bytes written to the file.
[edit] Notes
Attempting to use "?","*","<",">" or "|" in a filename will result in no file at all on Windows, while using ":" in a filename results in everything from the ":" and beyond being cut off from the file name and the resulting file will be of size 0.
Using the characters "/" or "\" in the filename (without directories that can be accessed that way) results in everything from this character and before being cut off from the filename. The file will be saved successfully nonetheless.
[edit] Example
Program test; Global struct My_struct Level_number="99"; string Map_name="Amazing map"; End Begin Save("myfile.sav",My_struct); // The content of My_struct is saved in myfile.sav Write(0,10,10,0,"Data saved!"); While (!key(_ESC)) Frame; End End
Used in example: save(), write(), key()
Files Functions | |
• Cd() • Chdir() • Fclose() • Feof() • Fgets() • File() • File_exists() • Flength() • Fopen() • Fputs() • Fread() • Fseek() • Ftell() • Fwrite() • Glob() • Load() • Mkdir() • Rmdir() • Save() • |