National Character String Literals
10.2
National Character String Literals behave the same as normal PL/B Language Literals. They are data strings (alpha, numeric, or a combination) that are not declared as variables. However, National Character String Literals can only contain valid UTF-8 encoded characters. They can be used in programs where a constant string value is needed. They may be in one of the following formats:
String - a sequence of UTF-8 characters - alpha, numeric and/or other special character that must be valid UTF-8 characters.
Character - a single UTF-8 character.
Number - a decimal integer number whose byte value is from 0 to 127.
Ctrl - binary, decimal, hex or octal representation whose byte value is 0 to 127.
Character literals may be defined in any supported numbering base as long as the byte value is from 0 to 127:
The following rules apply to string literals:
A national character string literal must be enclosed in quotes with a leading 'N' character (N"") in PL/B operations. However, when a national character string literal initializes a NCHAR array or NINIT data variable types, only quotes are used.
Example:
A national character string literal may be continued from one line to another by ending the first line with a pair of colons (::).
The Form Pointer is always one while the Length Pointer points to the last UTF-8 character.
National character string literals are generally the first OPERAND in most supported operations. The OPERATION formats are described later.
The following examples show how National Character String Literals may be used for OPERANDS:
A national character string literal may be continued on multiple lines:
See Also: Instruction Syntax
![]() |