| String literal | 'text'
'line1\nline2'
'{system.cancel}' | STRING[N], TEXT | A sequence of characters enclosed in single quotes, allowing to use the special sequences \n, \r, \t. To specify single quote and backslash characters, use the escape sequences \' and \\. A string literal can also be a localizable string. In this case the literal's class will be TEXT, and instead of the characters { and } it is necessary to use the special sequences \{ and \} respectively. If a string literal does not use localization capabilities, then the literal's class will be STRING[N] where N is the number of characters in the string. If the server is started with the logics.lsfStrLiteralsLanguage parameter (reverse translation of literals), then a string literal that does not use localization capabilities but matches the value of a ResourceBundle entry in that language is replaced at code parse time by that entry's id — it then behaves like the localizable string '{id}' and is displayed in the current locale. | |
| Raw string literal | r'text'
R'{not.a.key}'
r'C:\dir\file'
r!'don't stop'! | STRING[N] | A sequence of characters with the r or R prefix, enclosed in single quotes — either directly (r'...') or together with a delimiter character before the opening and after the closing quote (r!'...'!). The content is taken as is: special sequences are not interpreted, backslash and curly braces are ordinary characters (only the \r\n sequence is normalized to \n), localization capabilities are not available, and reverse translation is not performed. The delimiter form allows single quotes inside the literal: the literal ends at a quote immediately followed by the delimiter. Used for technical strings — paths, URLs, formats, JSON keys. The literal's class is STRING[N] where N is the number of characters in the string. | In the r'...' form a single quote character is not allowed inside. The delimiter can be any character except letters, digits, underscore, whitespace characters, the single quote, and the characters + * , = < > ( ) [ ] { } # |
| Integer literal (int) | 56
-32
1000000000 | INTEGER | A sequence of numbers with an optional minus sign at the beginning | 32-bit signed integers |
| Integer literal (long) | 56L
-32L
1000000000000L | LONG | A sequence of numbers with an optional minus sign at the beginning and the letter L (uppercase or lowercase) at the end | 64-bit signed integers |
| Floating-point literal | 3d
4.25D
-2.125D | DOUBLE | A sequence of numbers specifying the integer part, then a dot, then a sequence of numbers specifying the fractional part (possibly empty), then the letter D (uppercase or lowercase). With an optional minus sign at the beginning. | 64-bit floating point number |
NUMERIC class literal | 3
4.25
-2.125 | NUMERIC[N,M] | A sequence of numbers specifying the integer part, then a dot, then a sequence of numbers specifying the fractional part (possibly empty). With an optional minus sign at the beginning. | The number of digits of the integer and fractional parts of a literal is determined by its class |
| Logical literal | TRUE | BOOLEAN | Keyword TRUE | The opposite value is the special value NULL |
DATE class literal | 1982_07_13
2000_01_25 | DATE | Date in the format YYYY_MM_DD. Four digits specifying the year, an underscore, two digits for the month, an underscore, and two digits for the day. | |
TIME class literal | 12:05
00:59:59 | TIME | Time in the format HH:mm or HH:mm:ss. Two digits for the hours, two digits for the minutes, and optionally two digits for the seconds, separated by colons. | Hours from 0 to 23, minutes from 0 to 59, seconds from 0 to 59 |
DATETIME class literal | 1982_07_13_12:05
1982_07_13_12:05:00 | DATETIME | Date and time in the format YYYY_MM_DD_HH:mm or YYYY_MM_DD_HH:mm:ss | |
COLOR class literal | RGB(255, 0, 204)
#FF00CC | COLOR | Two definition forms. The first is the keyword RGB, then comma-separated values for the red, green, and blue components in parentheses. The second is the pound sign, then the values of the red, blue, and green components in hexadecimal format, using two characters per component. | Each number is from 0 to 255. In hexadecimal representation, you can use both uppercase and lowercase characters |