Rexx - Logical Operators


Advertisements

Logical Operators are used to evaluate Boolean expressions. Following are the logical operators available in Rexx.

Operator Description Example
& This is the logical “and” operator 1 or 1 will give 1
| This is the logical “or” operator 1 or 0 will give 1
\ This is the logical “not” operator \0 will give 1
&& This is the logical exclusive “or” operator 1 && 0 will give 1

Example

The following program shows how the various operators can be used.

/* Main program*/ 
say 1 & 0 
say 1 | 0 
say 1 && 0 
say \1 

The output of the above program will be −

0
1
1
0
rexx_operators.htm
Advertisements