SLUDGE

Treating Variables as Strings


You can treat any variable as a string... that means these things are all allowed:

say (ego, myVariable);

newVariable = "The name of the ego character is \"" + ego + "\".";

statusText (57219);

Here's what you'll get when using each of the data types as a string.

Undefined:

Always equates to "undefined".

Numbers:

Equates to the decimal representing the number, as you'd expect, complete with minus sign if required.

Strings:

Equates to the current value of the string. Oddly.

File handles:

If the game has been compiled in development mode, equates to the original name of the resource file. Otherwise, equates to "file handle".

Object types:

Equates to the on-screen name of the object type.

Stacks:

Equates to the string representation of each element, separated by a comma and a space. If the stack is empty, equates to "empty stack".

Function handles:

Equates to "pointer to function" if the function is user-defined or "pointer to BIF" if the pointer is built-in (ie. one of the functions in the Alphabetical List of Built-in Functions section).

Animations:

Aliays equates to "animation".

Costume:

Always equates to "costume".

See also:

Variable Operations

Spellchecking the Strings in your Game