## ALP Programming Guide and Reference

[prev][next][parent][TOC]

### String Literals

Description

Examples

A string literal contains a sequence of zero or more characters enclosed in quotation mark symbols. Either a single (') or double (") quotation mark symbol may be used as the quote character that opens and closes the string literal. If a single quotation mark symbol is used as the quote character, then double quotation mark symbols may appear as data characters within the string literal, and vice versa. If the quote character must also appear as a character within the string literal, use two adjacent quote characters; this will allow a single occurrence of the quote character to be inserted into the string literal.

A quote character must be used to terminate the string literal before the end of the line is reached, otherwise an error message is issued and the literal is terminated by the end of line character. A string literal may span multiple lines only if a backslash (\) appears as the last non- whitespace character on the line, in which case the backslash, all surrounding whitespace characters, and the end of line character are deleted and the literal is continued with the first character on the next line.

String-Literal:
D-String
S-String
D-String:
D-Quote D-Quote
D-Quote D-Char-Sequence D-Quote
S-String:
S-Quote S-Quote
S-Quote S-Char-Sequence S-Quote
D-Char-Sequence:
any printable character except D-Quote
D-Quote D-Quote
S-Char-Sequence:
any printable character except S-Quote
S-Quote S-Quote
D-Quote:
"
S-Quote:
'