SLUDGE

setCustomEncoding


Syntax:

setCustomEncoding (n);

Purpose:

Changes the way in which files are treated when created by the saveCustomData function or read by the loadCustomData function.

If the value of n is NULL (or FALSE, or NORMAL, or anything else that equates to 0) then saveCustomData creates text files. Text files can only contain strings. Should you use saveCustomData to save a stack which contains anything other than a string, a string representing the value will be stored instead.

If the value of n is any number between 1 and 65535 then saveCustomData will create encoded data files. Encoded data files can contain strings and numbers but no other variable types. Should you try to use saveCustomData to save a stack which contains anything other than a string or a number the engine will close with a fatal error message. This is because custom data files should be usable by any SLUDGE game and costumes, animations, file handles and so on are all game-specific.

If the value of n is less than 0 or greater than 65535 then the behaviour of saveCustomData and loadCustomData is not guaranteed. Don't do it. It's just plain dumb.

The default custom encoding setting before setCustomEncoding is called is 0.

Return value:

No return value.