# Literals

Name | Example | Class | Description | Constraints |
---|---|---|---|---|

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. | |

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` | `TIME` | Time in the format `HH:mm` . Two digits for the hours, a colon and two digits for the minutes. | Hours from 0 to 23, minutes from 0 to 59 |

`DATETIME` class literal | `1982_07_13_12:05` | `DATETIME` | Date and time in the format `YYYY_MM_DD_HH:mm` | |

`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 |