HP Pascal/iX Reference Manual (31502-90022)

4-: 11
----------------------------------------
| | | |
| a | b | a OR b |
| | | |
----------------------------------------
| | | |
| false | false | false |
| | | |
| false | true | true |
| | | |
| true | false | true |
| | | |
| true | true | true |
| | | |
----------------------------------------
Example
PROGRAM show_or(input,output);
VAR
ch : char;
time : Boolean;
energy : Boolean;
BEGIN
.
.
IF time OR energy THEN do_it;
.
.
IF (ch = 'Y') OR (ch = 'y') THEN ch := 'Y';
.
.
END.
Relational Operators
Relational
operators compare two operands and return a Boolean result.
The relational operators are <, <=, =, <>, >=, >, and IN. The following
lists the relational operators with their associated meanings:
OPERATOR MEANING
< less than
<= less than or equal to
= equal
<> not equal
>= greater than or equal
> greater than
IN set membership
Depending on the type of its operands, a relational operator may be
classified as
simple, set, pointer,
or
string
. For a description of
simple, set, pointer, or string relational operators, refer to the
appropriate section in this chapter.
Simple Relational Operators
A
simple relational
operator has operands of any simple type such as
integer, Boolean, char, real, longreal, enumerated, or subrange. All the
operators listed above, except IN, may be simple relational operators.
The operands must be type compatible, but the compiler may implicitly
convert numeric types before evaluation. For more information about
converting numeric types, refer to the section "Arithmetic Operators"
in this chapter.
For numeric operands, simple relational operators impose the ordinary
definition of ordering. For char operands, the ASCII collating sequence