Arithmetic Comparisons
Arithmetic comparisons can be used anywhere that a bit expression is
allowed. They are seen as TRUE if the comparison works, FALSE otherwise.
There are six arithmetic comparisons that can be made. Like the Logical
Operators, these also have both text and "C" representations. They are:
| Function |
Symbol |
| Less Than |
LT |
| Less Than or Equal To |
LE |
| Equal To |
EQ |
| Greater Than |
GT |
| Not Equal |
NE |
To indicate that it's a comparison, the notation is enclosed in square
brackets. The result can be used anywhere a bit variable is referenced. A
comparison might look like this:
[ JS1.A1 > JS2.A1 ]
which is TRUE if JS1.A1 is greater than JS2.A1.
It should be noted that the square brackets MUST enclose the comparison,
even when the comparison is already enclosed in parentheses as might be
the case in an IF/THEN sequence (discussed later).
Comparisons can be used for several things. For example, activating WEP when
the throttle is above a certain position. Keeping in mind that axis values
range from 0 to 255 and that maximum throttle is really the minimum value
internally, and assuming the throttle is on JS1.A3, you could write:
SCRIPT
CMS.B1 = [JS1.A3 < 25];
ENDSCRIPT
and cms.b1 will be on whenever JS1.A3 has a value greater than about 90%.
The CMS.B1 button is then programmed in the GUI to send a character
or activate a DX button to control WEP.