User Tools

Site Tools


This is an old revision of the document!


Expressions by themselves aren't much use to your stories. Unless you're writing a mathematical thriller, you probably don't need to evaluate 2 + 2 too often. Where they do come in handy, however, is when variables enter the picture.

A variable is a place to store a value so that you can remember it later. You can store both strings and numbers in variables. The variable $name might contain the main character's name, “Agatha Christie”, or the variable $money might contain the amount of money Agatha has in her pocket – the number 15.75.

Variable names

Variables have a few restrictions on their names. They must start with a $ sign. That's called a sigil — it tells the computer that what's coming next is a variable, not a number or string.

After the initial $ sign, a variable name can begin with a letter, either uppercase or lowercase, or an underscore _. After the first letter, you can have any combination of letters, numbers, or underscores. Punctuation and spaces aren't allowed anywhere.

Here are some legitimate variable names:


Some bad variable names:

$what was it called

To manipulate variables, see the articles for the <<set>> macro and the <<remember>> macro, as well as the link syntax.

variable.1387328877.txt.gz · Last modified: 2017/10/09 20:38 (external edit)