NET/MASTER Network Control Language (NCL) Reference Manual

Lexical Elements of NCL
Compiler Operation
8–6 106126 Tandem Computers Incorporated
A quoted string always has a constant value, corresponding to the sequence of
characters within the quotes. The maximum length of a quoted string is 2000
characters. A quoted string can include any character within the quotes, although to
aid readability or portability, it is recommended that you do not use unprintable
characters, such as control characters. Some examples of valid quoted strings are:
"A QUOTED STRING"
'The following characters are legal within quotes: !?~'
An example of an invalid quoted string is:
"Must use the same quote at the end'
You can include a quoted string within a quoted string. This is called nesting quotes.
If the inner quotes are of the same type as the outer quotes, you must double the inner
quotes to represent a quote. If the inner quotes are not of the same type as the outer
quotes, you do not have to double the inner quotes. Some examples of nesting quotes
are:
What You Type Resultant String Contents
'A ''B'' C' A 'B' C
"A ''B'' C" A ''B'' C
"A ''B"'"" C' A ''B"" C
"A ''B"""" C" A ''B"" C
"A ''"'B"'""" C" A ''B"" C
You have considerable flexibility in how you can use nested quotes to produce a
particular result.
Comments and compiler control statements are not recognized within a quoted string;
they are regarded as being part of the string. For example, the compiler does not
recognize the comment in the following quoted string:
"/* COMMENT */ This comment is part of the string"
Nor does the compiler recognize the compiler control statement in the following
quoted string:
'%%OPTION NODEFER This statement is part of the string too'
You can represent values in a quoted string. You can represent a hexadecimal string if
you follow the closing quote with the character X (or x) and this character is not the
start of another symbol. You can represent a binary string if you follow the closing
quote with the character B (or b) and this character is not the start of another symbol.
A hexadecimal string can contain only the characters 0 through 9, A through F, a
through f, and blank. If you use an odd number of hexadecimal digits, the compiler
adds a leading 0. Blanks are permitted only at logical byte boundaries, and no leading
or trailing blanks are permitted. The value of the string is the ASCII equivalent of the
hexadecimal characters.