Syntax
" { letter | digit | specialCharacter | escapedCharacter } [ ...n ] "
Parameters
letter
Refer to Literals.
digit
Refer to Literals.
specialCharacter
A special character, as listed:
~ | ` | ! | @ | # | $ | % | ^ |
& | * | ( | ) | _ | + | | | - |
= | \ | { | } | [ | ] | : | space |
" | ' | < | > | , | . | ? | / |
escapedCharacter
A quotation mark, hexcode, or non-printing character, as listed:
Escaped Character | Description |
---|---|
\\ | Backslash character |
\" | Quotation mark, not functioning as a string delimiter |
\e | Escape |
\f | Formfeed |
\n | New Line |
{} | Tagged Document |
< | Beginning of Word |
> | End of Word |
\r | Carriage return |
\t | Horizontal tab |
\v | Vertical tab |
\x<2-digit hex code> | Unicode character corresponding to the specified 2-digit hexadecimal code. For example, "COL\x41" is equivalent to "COLA". Note: The 2-digit hexadecimal code must be an ASCII hexadecimal code. |
@xx@ | Unicode character corresponding to the specified 2-digit EBCDIC hexadecimal code. For example, "COL@C1@" is equivalent to "COLA". |
Notes:
To incorporate a backslash character in a string literal, you will need to escape the character by adding an extra backslash, so that it is represented as a double-backslash in a literal string. For example, the command Attach "\\" MyString concatenates a single backslash character on the end of the MyString variable.
Similarly, to represent a backslash in a filename literal, you will need to add an extra backslash in the path name. For example, "C:\\Folder\\File.txt".
Description
String literals are LDL+ primitive values that only have character significance. Refer to Numeric Literals for more information on literals that have numerical significance.
Note: A national string literal such as a Kanji character can only be compared to another national string literal.
Escape Characters
Escape characters, such as '\n', primarily have significance in particular execution contexts. Outside of these contexts any character that follows the escape character ('\') inside a literal is treated as an instance of itself – the '\' is ignored.
Non-printable Characters
This helps to specify non-character data values.
In addition to the ‘\xnn’ syntax to represent a character as a hexadecimal code, the ‘@xx@’ syntax can be used to specify non-character literal values, where ‘@’ character indicates the start of a hexadecimal constant and ‘xx’ indicates hexadecimal digits.
While using '@xx@' syntax, the value of 'xx' must be EBCDIC hexadecimal characters. This is a variation of the general escape notation that can be used to include other non-printable characters in string literals, such as new line, tab, and line feed. For example, to represent a line feed character, use the '@25@' syntax, where 25 represents a line feed character in EBCDIC hexadecimal code.
Examples
Example 1
"This is a string literal"
Example 2
"So is this (*(*�-39-9"
Example 3
"With embedded \"delimiters\""
Example 4 (can be treated as string or numeric literal depending upon the usage context)
"987.123"