BS2 CodingHelp LOAD&SAVE

From FSG Wiki

Jump to: navigation, search

Help Main Menu

Contents

Load/Save

This is about sandbox loading and saving.

SAVE SAND filename

This will save the Sandbox to the filename you provide. This will be in BS2 folder. The name must not contain spaces.

LOAD SAND filename

This wil load the Sandbox from the filename you provide. Same as above.

SAVE QUICKSAND quicksandid

This will save the Sandbox to RAM. This is more than 100 times faster than saving to file.

LOAD QUICKSAND quicksandid

This will load the Sandbox from ROM.


Files

This is about opening a file and loading or saving variable or a message into a file.

File access functions

These functions operate directly on the file.

FILE OPEN filename

This will make the given filename as the current opened file.

FILE CLOSE

This will close the currently opened file.

FILE DELETE filename

This will simply delete the given filename.

Save & Load functions

Very simple to use.

SAVE VAR varname value

This will add "SET varname value" to the currently open file. So if you have previously opened a file, if i execute this to save the variable MyVAR (MyVAR=100):

SAVE VAR MyVAR MyVAR

The currently opened file will have this line written to it SET MyVAR 100

Dont forget to close a file after writing to it. Then if you want to load the file you simply use this:

INCLUDE filename

The filename being the file you previously write your data to. Since the file contain SET command it will execute every line, so after this it would set MyVAR to 100.

Personal tools