TACL Reference Manual

HP NonStop TACL Reference Manual429513-018
3-1
3 Expressions
An expression can be a text, string, or integer constant, a variable, or a value obtained
by combining constants, variables, and other expressions with operators. This section
describes operators and how to use them in expressions.
Operators
Operators perform operations on values. The operators provided by TACL can be
divided into four categories:
Arithmetic
Relational
Logical
String
Operators have an order of precedence; when several operations take place within the
same program statement, operations with higher precedence are performed before
operators with lower precedence. Table 3-1 lists the category, function, and relative
precedence of each operator; a lower number indicates higher precedence. To change
the order of precedence, use parentheses. A subexpression in parentheses is
evaluated before the rest of the expression that contains it.
Table 3-1. TACL Operators (page1of2)
Operator Function Type of Operation Precedence
NOT NOT Logical 0
* Multiplication Arithmetic 1
/ Division Arithmetic 1
+ Addition Arithmetic 2
- Subtraction Arithmetic 2
> Greater than Relational (integers) 3
< Less than Relational (integers) 3
>= Greater than or equal to Relational (integers) 3
<= Less than or equal to Relational (integers) 3
= Equal to Relational (integers) 3
<> Not equal to Relational (integers) 3
‘+’ Concatenation String 3
'>' or '!>' Greater than Relational (strings) 3
'<' or '!<' Less than Relational (strings) 3
'>=' or '!>=' Greater than or equal to Relational (strings) 3
'<=' or '!<=' Less than or equal to Relational (strings) 3