Programming instructions

23
Intermec Fingerprint 6.13 – Programmer's Guide
Continued!
9. Operators
There are three main types of operators – arithmetic, relational, and
logical:
Arithmetic Operators (integers only)
+ Addition (e.g. 2 + 2 = 4)
- Subtraction (e.g. 4 - 1 = 3)
* Multiplication (e.g. 2 * 3 = 6)
\ Integer division (e.g. 6 \ 2 = 3)
MOD Modulo arithmetic (results in an integer value which is the
remainder of an integer division, e.g. 5MOD2 = 1)
^ Exponent (e.g. 5 ^ 2 = 25)
Parentheses can be used to specify the order of calculation, e.g.:
7+5^2\8 = 10
(7+5^2)\8 = 4
Relational Operators
< less than
<= less than or equal to
<> not equal to
= equal to (also used as an assignment operator)
> greater than
>= greater than or equal to
Relational operators return:
-1 if relation is TRUE.
0 if relation is FALSE.
The following rules apply:
Arithmetic operations are evaluated before relational operations.
Letters are greater than digits.
Lowercase letter are greater than their uppercase counterparts.
The ASCII code “values” of letters increase alphabetically and
the leading and trailing blanks are significant.
Strings are compared by their corresponding ASCII code value.
Logical Operators
AND conjunction
OR disjunction
XOR exclusive or
EQV equivalent
Logical operators combine simple logical expressions to form more
complicated logical expressions. The logical operators operate
bitwise on the arguments, e.g.:
1 AND 2 = 0
Logical operators can be used to connect relational operators, e.g.:
A%10 AND A%<100
4. TERMINOLOGY AND SYNTAX, cont'd.