Assignment Statements
The simplest and probably the most used operation that the script can
perform is the assignment of a value to a variable. This is done using the
"=" operator and is written like a mathematical equation. For example:
CMS.A1 = JS1.A2;
sets Axis 1 on the CMS Control to be equal to the current value of Axis 2
(the Y axis) on the JS1 device. Similarly (for bit values):
CMS.B1 = JS1.B5;
will set Button 1 on the CMS Controls to have the same state as Button 5
on the JS1 device.
The variable to the left of the "=" must be a variable that can be set.
These include the built-in variables and the CMS variables. You cannot put
a JSx variable left of the "=" since the script cannot change the values of
the real devices.
To the right of the "=", you can use any valid expression. These can
reference any variable, and can include the arithmetic and logical
operators, parentheses, etc. as necessary. For example:
CMS.A1 = JS1.A1 + JS1.A2 + 10;
CMS.B1 = (JS1.B5 OR JS1.B6) AND NOT (JS1.B6 OR JS2.B7);
Note that the expressions end with a ";". This is necessary for any
assignment type of statement. For other types of statements to be discussed
later, the ";" is necessary in some cases and unnecessary in other. These
will be discussed along with their individual functions. In general, the ";"
causes no problems even when it's used where it's not needed, so when in
doubt, put one at the end of the statement.