User`s manual
1-6
Relational Operators
These are the same as LEVEL I.
< (less than) > (greater than) =(equal to)
<> (not equal to) <=(less than or equal to) >=(greater than or equal to)
These operators are useful both for IF … THEN statements and for logical arithmetic.
Example:
100 IF C<=0 THEN C=127
Logical Operators
In LEVEL I BASIC, * and + were used to represent the logical operators AND
and OR. In LEVEL II, we don't use symbols, we use AND and OR directly.
We also have another operator, NOT.
Examples:
50 IF Q = 13 AND R2 = 0 THEN PRINT "READ"
100 Q = (G1<0) AND (G2<L)
Q = 1 if both expressions are
True; otherwise Q = 0
200 Q = (G1<0) OR (G2<L)
Q = –1 if either expression is
True; otherwise Q = 0
300 Q = NOT(C>3)
Q = 1 if the expression is
False; Q = 0 if it is True
400 IF NOT (P AND Q) THEN PRINT "P AND Q ARE NOT BOTH EQUAL TO -1"
500 IF NOT (P OR Q) THEN PRINT "NEITHER P NOR Q EQUALS-1"










