PS TEXT FORMAT Reference Manual
Expressions
11387 Tandem Computers Incorporated 5-3
Complex Expressions A complex expression is a group of primary expressions, also called
operands, that are combined with operators; the operators indicate actions for
TFORM to perform on the operands to evaluate the expression to a single
result. The types of operators, and the actions they perform, must match
the types of the operands (this is explained further under “Operands” and
“Operators” later in this section).
Expression Types An expression is one of three types: string, numeric, or Boolean. TFORM
computes a value for an expression, depending on what operands and
operators you give, and that type is then associated with the expression.
TFORM can perform algebraic and logical calculations with expressions of
numeric or Boolean types; string types are viewed literally. When you
build complex expressions, TFORM can only evaluate operands of like
types. However, if you need to combine unlike elements (for example,
string and numeric elements), you can convert one element’s type to match
another’s by using the NUMERIC or STRING function (these functions are
detailed later in this section).
Examples of Expressions Table 5-1 is a summary of the syntax of an expression, from the most
complex down to the simplest. The term “character” means any character
you can type in; “digit” is any ASCII numeral. The symbol “::=” means
“is defined as.”
To illustrate these expressions, spaces are added for improved readability.
However, TFORM views a space (except within a string) as the end of the
expression. You can’t have spaces anywhere else in an expression; the
exception is if the expression with spaces is enclosed in an indirection
escape sequence: \(x + y\), for example.