HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
3- 30
99 END 99 END
If array A has Maxindex elements, and Index is greater than Maxindex,
then the statement
100 IF (Index <= Maxindex) AND (A(Index) =5) THEN GOTO 500
does not evaluate A(Index), and an error does not occur. The statement
200 IF (Index <= Maxindex) LAND (A(Index) = 5) THEN GOTO 600
does evaluate A(Index), and an error occurs (subscript out of range).
Table 3-25 is the truth table for the LOR and OR operators. The OR
operator evaluates the first operand, and if it is TRUE, the result is
TRUE and the second operand is not evaluated. The LOR operator evaluates
both operands regardless of the value of the first.
Table 3-25. LOR/OR Truth Table
---------------------------------------------------------------------------------------------
||||
| X | Y | X {OR LOR} Y |
||||
---------------------------------------------------------------------------------------------
||||
| TRUE | TRUE | TRUE |
||||
---------------------------------------------------------------------------------------------
||||
| TRUE | FALSE | TRUE |
||||
---------------------------------------------------------------------------------------------
||||
| FALSE | TRUE | TRUE |
||||
---------------------------------------------------------------------------------------------
||||
| FALSE | FALSE | FALSE |
||||
---------------------------------------------------------------------------------------------
Examples
These expressions are TRUE:
(X < (X+1)) OR (2 < 3) (X < (X+1)) LOR (2 < 3)
(X <= (X+1)) OR (5 = 3) (X <= (X+1)) LOR (5 = 3)
(9-(3**2)) OR ("a" < "z") (9-(3**2)) LOR ("a" < "z")
These expressions are FALSE:
0 OR (5-5) 0 LOR (5-5)
(9-(3**2)) OR (9-(6+3)) (9-(3**2)) LOR (9-(6+3))
(X-X) OR ("a" > "z") (X-X) LOR ("a" > "z")
The program on the left below evaluates FNI(I); the program on the right
does not. If the function FNI subtracts one from its argument, then the
program on the left prints "1 0" and the program on the right prints "1
1".