Operators
Notes: There are different operators used for equality and assignment in this scripting language.
To test equality, use the == (two equal signs). This is a relational operator that says, TEST if the left side is equal to the right side. as in IF A == B THEN .......
To do an assignment, use the = (one equal sign). This is the assignment operator. It says MAKE the left side equal to the right side. As in A = B, set A equal to B.
If you use the assignment operator in an IF statement as in IF A = B THEN .... it will ALWAYS be true, (if B is non zero) because the interpreter will MAKE A equal to B.
As an additional note, this is not uncommon in programming languages. Maybe a mnemonic like "two is test" will help. In any case, be aware of whether you are TESTING or ASSIGNING.
Math Operators
^ Exponentiation
* Multiply
/ Divide
% Modulo
MOD Modulo
+ Add
- Subtract
( Open parentheses
) Close parentheses
= Assignment
String Operators
+ Concatenation
Relational Operators
== Equal to
<> Not equal to
< Less than
> Greater than
<= Less than equal to
>= Greater than equal to
Logical Operators
AND, &
OR, |
NOT, !
Miscellaneous operators
' Used to add comments to the script
" Used to define the start and end of a string
, Parameter separator
. Decimal point
: Used to define a line label
() array subscript, precedence enforcing
Unary Operators
- Negation
-- Subtracts 1 from a variable
++ Adds 1 to a variable