TAL Programmer's Guide

Simple Variables by Data Type
Using Simple Variables
096254 Tandem Computers Incorporated 6–5
Multiple Variables You can assign a value to more than one simple variable at a time. In the following
example, the first assignment statement is equivalent to the three assignment
statements that follow it:
INT int1;
INT int2;
INT int3; !Declarations
int1 := int2 := int3 := 16; !First assignment statement
int1 := 16; !These three assignment
int2 := 16; ! statements are equivalent to
int3 := 16; ! the first assignment statement
Simple Variables
by Data Type
The following subsections present information about simple variables depending on
their data type.
STRING Simple Variables A STRING simple variable can contain an unsigned 8-bit integer in the range 0
through 255 or a one-character character string:
STRING a := 59; !Decimal number
STRING b := %12; !Octal number
STRING c := %B101; !Binary number
STRING d := %h2A; !Hexadecimal number
STRING e := "A"; !Character string
Storage Allocation
A STRING simple variable represents a byte value, but the compiler allocates a word.
The compiler allocates the initialization value in the left byte of the word. The right
byte is undefined. Here are allocation examples of initializations with a character
string and a number:
"A" ?
254 ?
352
STRING a_char := "A";
STRING byte_num := 254;