User Guide

Operators
47
Axcess Programming Language
Operators
Changing and Comparing Values
In your Axcess program, you may need to increase the value of a variable, to see if that variable has
reached a certain value, or to compare different values to each other. The tools that you use to
perform these tasks are called operators. There are four types of operators in Axcess: arithmetic,
relational, logical, and bitwise.
Arithmetic Operators
Arithmetic operators create a numeric value from one or more operations, such as addition,
multiplication, and division. They are listed in the table below.
Here is an example of arithmetic operators in an Axcess program:
X = 7 + 5
Y = X * 3
In the example above, X = 12 and Y = 36. There is an order of precedence for arithmetic operators;
that is, some operations are performed first and others second. For example, multiplication
operations (*) are performed before addition operations (+).
Here is an example that illustrates this precedence:
X = 7 + 5 * 3
Reading this expression left to right, X = 36. However, since multiplication takes precedence,
X = 22 (5 * 3 = 15, and 7 + 15 = 22). For detailed information on precedence, refer to
the Precedence Among Operators section on page 51.
Relational Operators
Relational operators, compare two numeric values and produces a true or false result. These
operators are listed below.
Here is an example of these operators in practice:
Arithmetic Operators
Symbol Function Symbol Function
+Add / Divide
- Subtract % Modulus
* Multiply
Relational Operators
Symbol Function Symbol Function
< Less than <= Less than or equal to
> Greater than >= Greater than or equal to
= Equal to <> Not equal to