HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

3- 29
Examples
These expressions are TRUE:
NOT 0 NOT (X-X) NOT (5 = 3) NOT ("HP" < "Competitors)
These expressions are FALSE:
NOT 1 NOT 3600 NOT (5 > 3) NOT("HP" # "Hewlett Packard")
Table 3-24 is the truth table for the LAND and AND operators. The AND
operator evaluates the first operand, and if it is FALSE the result is
FALSE and the second operand is not evaluated. The LAND operator
evaluates both operands regardless of the value of the first one.
Table 3-24. LAND/AND Truth Table
---------------------------------------------------------------------------------------------
||||
| X | Y | X {LAND AND} Y |
||||
---------------------------------------------------------------------------------------------
||||
| TRUE | TRUE | TRUE |
||||
---------------------------------------------------------------------------------------------
||||
| TRUE | FALSE | FALSE |
||||
---------------------------------------------------------------------------------------------
||||
| FALSE | TRUE | FALSE |
||||
---------------------------------------------------------------------------------------------
||||
| FALSE | FALSE | FALSE |
||||
---------------------------------------------------------------------------------------------
Examples
These expressions are TRUE:
(2 > 1) AND (1 > 0) (2 > 1) LAND (1 > 0)
((X-1) <= X) AND (X <= (X+1)) ((X-1) <= X) LAND (X <= (X+1))
1 AND (1+0) 1 LAND (1+0)
(3*5) AND ((1+2)/5) (3*5) LAND ((1+2)/5)
("a" < "b") AND ("ant" < "bug") ("a" < "b") LAND ("ant" < "bug")
These expressions are FALSE:
(2 = 1) AND (1 > 0) (2 = 1) LAND (1 > 0)
((X-1) <= X) AND (X > (X+1)) ((X-1) <= X) LAND (X > (X+1))
(3*5) AND (0/5) (3*5) LAND (0/5)
("a" = "ant") AND ("b" = "bug") ("a" = "ant") LAND ("b" = "bug")
The program on the left below evaluates FNI(I); the program on the right
does not. If the function FNI adds one to its argument, then the program
on the left prints "0 1" and the program on the right prints "0 0".
10 I=0 10 I=0
20 PRINT (I LAND FNI(I)); I 20 PRINT (I AND FNI(I)); I