2. Language Elements : Expressions : Operators : Logical Operators : Truth table for AND comparisons:
 
Share this page                  
Truth table for AND comparisons:
True
False
Null
True
True
False
null
False
False
False
False
Null
null
False
null
Truth table for OR comparisons:
True
False
Null
True
True
True
True
False
True
False
null
Null
True
null
null
Truth table for NOT comparisons:
True
False
Null
False
True
Null
 
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.