pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

Constants
Character String (page 57)
STRING Numeric (page 58)
INT Numeric (page 58)
INT(32) Numeric (page 59)
FIXED Numeric (page 61)
REAL and REAL(64) Numeric (page 62)
Constant Lists (page 63)
Constant List Alignment Specification (page 64)
Character String
A character string constant consists of one or more ASCII characters stored in a contiguous group
of bytes.
string
is a sequence of one or more ASCII characters enclosed in quotation mark delimiters. If a
quotation mark is a character within the sequence of ASCII characters, use two quotation marks
(in addition to the quotation mark delimiters). The compiler does not upshift lowercase characters.
Each character in a character string requires one byte of contiguous storage. The maximum length
of a character string you can specify differs for initializations and for assignments.
Initializations
You can initialize simple variables or arrays of any data type with character strings.
When you initialize a simple variable, the character string can have the same number of bytes as
the simple variable or fewer. This example declares an INT variable and initializes it with a
character string:
INT chars := "AB";
When you initialize an array, the character string can have up to 127 characters and must fit on
one line. If a character string is too long for one line, use a constant list (described Constant Lists
(page 63)) to break the character string into smaller character strings.
Assignments
You can assign character strings to STRING, INT, and INT(32) variables, but not to FIXED, REAL,
or REAL(64) variables.
In assignment statements, a character string can contain at most four characters, depending on
the data type of the variable:
Data Types to Which String Can Be AssignedNumber of Bytes in String
STRING, INT1
STRING, INT2
INT(32)3
INT(32)4
Constants 57