pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Example 10 Assigning Character Strings to Variables
STRING s;
INT i;
s := "a"; ! OK
s := "ab"; ! OK: same as s := "b"
s := "abc"; ! ERROR: too big
i := "a"; ! OK
i := "ab"; ! OK
I := "abc"; ! ERROR: too big
STRING Numeric
Unsigned 8-bit integerRepresentation
0 through 255Range
base
indicates a number base as follows:
%Octal
%bBinary
%hHexadecimal
If you omit the base, the default base is decimal.
integer
is one or more of the following digits:
0 through 9Decimal
0 through 7Octal
0 or 1Binary
0 through 9, A through F (not case-sensitive)Hexadecimal
Examples of STRING numeric constants:
255Decimal
%12Octal
%B101Binary
%h2AHexadecimal
INT Numeric
Signed or unsigned 16-bit integerRepresentation
0 through 65,535Range (unsigned)
-32,768 through 32,767Range (signed)
58 Data Representation