ENFORM Reference Manual
Arithmetic Expressions
ENFORM Language Elements
058057 Tandem Computers Incorporated 3–23
String literals can stand alone as target-items in a LIST statement. Using a string literal
in this manner allows printing of one or more constant characters between two
columns of data. For example:
LIST customer,"....",address;
produces the following report:
CUSTOMER ADDRESS
------------------ -----------------------
CENTRAL UNIVERSITY....UNIVERSITY WAY
BROWN MEDICAL CO ....100 CALIFORNIA STREET
Arithmetic
Expressions
Arithmetic expressions are some combination of numeric literals, field values,
variables, or aggregates that are added, subtracted, multiplied, or divided to yield a
single value. A JULIAN-DATE clause, TIMESTAMP-DATE clause, or a TIMESTAMP-
TIME clause can also be used in an arithmetic expression. Arithmetic expressions
must be enclosed in parentheses.
Table 3-3 shows the arithmetic operators and their functions.
Table 3-3. Arithmetic Operators
Operator Function
+ Addition
– Subtraction
* Multiplication
/ Division
Spaces are not required before any of the arithmetic operators with the exception of
the subtraction sign (–). At least one space must precede a subtraction sign that
follows a field or variable name.
Arithmetic expressions can be simple:
(price + 10.00)
or they can be complex:
((price + 10.00)* quantity)
Evaluation Order of
Arithmetic Expressions
Arithmetic expressions are evaluated in this order:
1. Nested parenthesized expressions are evaluated first, beginning with the
innermost expression.
2. Within a nested parenthesized expression, multiplication and division operations
are evaluated next.
3. Within a nested parenthesized expression, addition and subtraction operations are
evaluated last.