This wiki is out of date, use the continuation of this wiki instead

Save

From FenixWiki

Revision as of 10:27, 23 May 2008 by 85.144.194.29 (Talk)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search


Contents

Definition

INT save ( <STRING filename> , <VARSPACE data> )

Saves the data from any variable to the specified file.

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.

Returns

INT : The number of bytes written to the file.

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 accesssed that way) results in everything from this character and before being cut off from the filename. The file will be saved successfully nontheless.

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: write(), key()

Personal tools