Labels¶
Labels are used to jump to a specific point in the script. They are defined by
the label
keyword followed by the label name and a semicolon. Labels can be
used with the goto
keyword to jump to the label.
Label names follow the same rules as variable names:
- Names are case-sensitive, e.g.
foo
andFoo
are two different names. - Names can only contain letters, numbers and underscores. Diacritics are not allowed.
- Names must start with a letter or an underscore.
- Names cannot be the same as a keyword.
- Labels cannot have the same name as a variable, constant, function, rule or rule group.
Syntax of labels
Example of a label
Age3AI.xs | |
---|---|
Duplicate labels
The game does not prevent you from creating multiple labels with the same name. It's not fully clear what happens when you do this, but it's best to avoid it.