PS TEXT FORMAT Reference Manual

Expressions
5-2 11387 Tandem Computers Incorporated
Primary Expressions TFORM expressions can be divided into two categories: primary and
complex expressions. A primary expression represents a single value.
TFORM evaluates all primaries before going on to evaluate higher ranking
entities. Primary expressions include constants, variables, and functions;
these are described below.
A constant is any expression that contains a value in its structure that can
never change. This kind of expression can be simple, such as a single digit
or an empty string; a combination of digits making up a number; or a
collection of characters in a string.
A variable is a kind of expression that represents a value of either numeric
or string type. You create these variables as you need them. A variable
must start with a letter; is limited to 32 characters; and can contain letters,
numbers, and underscore characters (which are used as word separators,
since spaces aren’t allowed).
Besides the variables you create, TFORM maintains a number of system
variables that you can access for use in expressions. You can read system
variables and use their values, but you can’t directly assign values to them.
A function also yields a single value, but instead of symbolically
representing a value (as a variable does), a function evaluates one or more
arguments and returns a value from that process. A function can produce
an object with a type or value that is different from the type or value of the
arguments the function evaluated.
You can use functions to do many things; for example, you can obtain the
absolute (unsigned) value of a number, convert numeric entities to strings
and vice versa, convert numbers to their Roman-numeral equivalents, find
the length of an expression in characters, find the larger (or smaller) of two
values, select one expression from a list of expressions, or isolate a
substring in a larger string.