TAL Programmer's Guide
Operands
Using Expressions
5–12 096254 Tandem Computers Incorporated
Using LITERALS
You can use LITERALs in declarations and statements:
LITERAL array_length = 50; !Length of array
INT .buffer[0:array_length - 1]; !Declare array
You can also use LITERAL identifiers in subsequent LITERAL declarations:
LITERAL number_of_file_extents = 16,
file_extent_size_in_pages = 32,
file_size_in_bytes = (number_of_file_extents '*'
file_extent_size_in_pages) * 2048D !bytes per page!;
Standard Functions A function is a procedure or subprocedure that returns a value to the calling
procedure or subprocedure. Table 5-7 summarizes the kinds of operations that
standard (built-in) functions perform.
Table 5-7. Summary of Standard Functions
Category Operation
Type transfer Converts an expression from one data type to another
Address conversion Converts standard addresses to extended addresses or extended addresses
to standard addresses
Character test Tests for an alphabetic, numeric, or special ASCII character; returns a true
value if the character passes the test or a false value if the character fails the
test
Minimum-maximum Returns the minimum or maximum of two expressions
Carry and overflow Tests the state of the carry or overflow indicator in the environment register;
returns a true value if the indicator is on or a false value if it is off
FIXED expression Returns the fpoint, or moves the position of the implied decimal point, of a
FIXED expression
Variable Returns the unit length, offset, data type, or number of occurrences of a
variable
Miscellaneous Tests for receipt of actual parameter; returns the absolute value or one’s
complement from expressions; returns the setting of the system clock or
internal register pointer
For example, the $DBL standard function converts an expression from any data type to
a signed INT(32) expression. In the following example, $DBL converts an INT
expression to a signed INT(32) expression:
INT a; !Declare an INT variable
INT(32) b; !Declare an INT(32) variable
!Some code here
b := $DBL (a); !Convert A to INT(32) expression
! and store it in B
Other examples are shown in various sections of this manual. Each standard function
is described in the TAL Reference Manual.