Propeller Manual

Table Of Contents
2: Spin Language Reference – Operators
Here, the Is Less Than operator returns TRUE if Y is less than 32.
Is Less Than has an assignment form,
<=, that uses the variable to its left as both the first
operand and the result destination. For example,
X <= Y 'Short form of X := X < Y
Here, X is compared with Y, and if X is less than Y, X is set to TRUE (-1), otherwise X is set to
FALSE (0). The assignment form of Is Less Than may also be used within expressions for
intermediate results; see Intermediate Assignments, page 147.
Boolean Is Greater Than ‘
>’, ‘>=
The Boolean operator Is Greater Than compares two operands and returns
TRUE (-1) if the
first value is greater than the second value, or returns
FALSE (0), otherwise. Is Greater Than
can be used in both variable and constant expressions. Example:
X := Y > Z
The above example compares the value of Y with the value of Z and sets X to either: TRUE (-1)
if
Y is greater than the value of Z, or FALSE (0) if Y is equal to or less than the value of Z.
This operator is often used in conditional expressions, such as in the following example.
IF (Y > 50)
Here, the Is Greater Than operator returns TRUE if Y is greater than 50.
Is Greater Than has an assignment form,
>=, that uses the variable to its left as both the first
operand and the result destination. For example,
X >= Y 'Short form of X := X > Y
Here, X is compared with Y, and if X is greater than Y, X is set to TRUE (-1), otherwise X is set to
FALSE (0). The assignment form of Is Greater Than may also be used within expressions for
intermediate results; see Intermediate Assignments, page 147.
Boolean Is Equal or Less ‘
=<’, ‘=<=
The Boolean operator Is Equal or Less compares two operands and returns
TRUE (-1) if the
first value is equal to or less than the second value, or returns
FALSE (0), otherwise. Is Equal
or Less can be used in both variable and constant expressions. Example:
X := Y =< Z
Propeller Manual v1.1 · Page 171