Commodore 128 System Manual page 356

Hide thumbs Also See for 128:
Table of Contents

Advertisement

There are also operators for equalities and inequalities, called
RELATIONAL operators. Arithmetic operators always take priority
over relational operators.
<
>
< = or = <
> = or = >
< > or > <
Finally, there are three LOGICAL operators, with lower priority
than both arithmetic and relational operators:
AND
OR
NOT
These are most often used to join multiple formulas in IF ... THEN
statements. When they are used with arithmetic operators, they
are evaluated last (i.e., after + and -). If the relationship stated in
the expression is true, the result is assigned an integer value of -
1. If false, a value of 0 is assigned.
EXAMPLES:
IF A=B AND C=D THEN 100
IF A=B OR C=D THEN 100
A=5:B=4:PRINT A=B
A=5:B=4:PRINT A>3
PRINT 123 AND 15:PRINT 5 OR 7
19-6
is equal to
is less than
is greater than
is less than or equal to
is greater than or equal to
is not equal to
Requires both A =B &
C=D to be true
Allows either A=B, C=D,
or both, to be true
Displays a value of 0
Displays a value of -1
Displays 11 and 7

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents