Literals
Numbers
Numbers are either integers or floating point numbers in the following notation:
42
-13.42
It is important to note that floating point numbers must always be specified in English notation with "." as the decimal separator and without a thousands separator if they appear directly in a TL script expression. In outputs and inputs, however, numbers can of course be formatted using the conventions of the user's language, see Number format.
Boolean values
true
The literal for the boolean value "true".
false
The literal for the boolean value "false".
Character strings
The expressions "some string" and 'some other string' represent the literal string values some string and some other string.
Note: In an internationalized application, a character string should not be used directly for communication with the user. Instead, internationalized texts should be used.
Special characters can be written in character strings using a backslash escape:
| Escape character | Meaning |
|---|---|
| \t | Tabulator character (ASCII no. 9) |
| \b | Backspace (ASCII no. 8) |
| \r | Carriage return (ASCII no. 13) |
| \n | Line break (ASCII no. 10) |
| \f | Form feed (ASCII no. 12) |
| \uABCD | The Unicode character with the hex code ABCD. |
The character string "first line\nsecond line" represents the two-line text with "first line" in the first line and "second line" in the second line.
The character string "20 \u20AC" is evaluated to "20 €".
Text blocks
If you want to insert multi-line text directly into a script, text blocks are the better alternative to character strings with escape characters.
"""
first line
second line
"""
This text block is equivalent to the character string "first line\nsecond line" from the example above. The entire text block can be indented to match the indentation of the surrounding script without changing its content.
No value
null
The literal for the empty/undefined value "null".