PS TEXT FORMAT Reference Manual

Expressions
11387 Tandem Computers Incorporated 5-13
Operands As defined before, operands are groups of constants or variables that are
combined with operators and then reduced to a single value. Before going
on to the operators, here are some things to remember about operands:
TFORM stores all numeric values as 32-bit binary data with an implied
decimal point 3 places from the right end, so the range for numeric
values is from –2147483.647 through +2147483.647.
Since a string must be enclosed in quotes, you need to use two
consecutive quotation marks to indicate that you’re using a quote as a
data character within a string; for example, “They all shouted ““LOOK
OUT!”” in unison.”
You can cause TFORM to think of a numeric value as a Boolean, or
logical, value: In a Boolean context, TFORM views zero as “false” and
anything else as “true.” When an expression produces a Boolean
result, it yields 1 for true, 0 for false.
You can’t combine two operands with one operator unless both
operands are of the same type (both numeric or both string); for
example, TFORM produces an error message for expressions such as
“K” +3.
Operators Operators define actions to be performed on one or two operands to
produce a single result. Operators are of three types:
1. Unary operators use the value of a single operand.
2. Binary operators specify arithmetic computation or string
manipulation involving two operands of the proper type.
3. Logical operators specify comparisons and Boolean operations and
yield a Boolean result.
Unary Operators The unary operators are the algebraic + and – which affirm or negate the
algebraic sign of the numeric entity immediately following, and the
Boolean ! which negates the Boolean entity immediately following (logical
“not” ). See Table 5-6.