Truth table for AND comparisons:
Truth table for OR comparisons:
Truth table for NOT comparisons:
The order of precedence for these operators, from highest to lowest, is as follows:
NOT
AND
OR
You can use parentheses to change this order. In the following example:
if (empnum > 0 or deptno > 0) and status != 3
OpenROAD first evaluates empnum and deptno and then evaluates status.
The following example illustrates the use of comparison and logical operators:
if empnum > 0 and status != 3 then
callframe newemployee;
endif;
The newemployee frame is called only if both conditions are TRUE, that is, if the current value of empnum is greater than 0, and status has any value other than 3.