Language basics / Literals |
Text literals define a character string in an expression.
" char [...] "
' char [...] '
A text literal (or character string literal) defines a character string constant containing valid characters in the current application character set. The application character set is defined by the current locale.
A text literal can be written on multiple lines, the compiler merges lines by removing the newline character.
An empty string ("") is equivalent to NULL.
The escape character is the backslash character (\).
DISPLAY ' 2 double quotes: " " 2 single quotes: '' \' ' displays as: 2 double quotes: " " 2 single quotes: ' '
DISPLAY " 2 double quotes: "" \" 2 single quotes: ' ' " displays as: 2 double quotes: " " 2 single quotes: ' '
DISPLAY "First line\nSecond line"
The \xNN hexadecimal notation allows you to specify control characters in a string literal. Only ASCII codes (<=0x7F) are allowed.
MAIN DISPLAY "Some text in double quotes" DISPLAY 'Some text in single quotes' DISPLAY "Include double quotes: \" "" " DISPLAY 'Include single quotes: \' '' ' DISPLAY 'Insert a newline character here: \n and continue with text.' DISPLAY "This is a text on multiple lines.\ You can insert a newline with back-slash at the end of the line." IF "" IS NULL THEN DISPLAY 'Empty string is NULL' END IF END MAIN