
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
Содержание Axcess
Страница 1: ...instruction manual Software Axcess Programming Language ...
Страница 8: ...vi Axcess Programming Language Table of Contents ...
Страница 12: ...Introduction 4 Axcess Programming Language ...
Страница 22: ...Axcess Basics 14 Axcess Programming Language ...
Страница 38: ...Channel Characteristics 30 Axcess Programming Language ...
Страница 54: ...Levels 46 Axcess Programming Language ...
Страница 62: ...Operators 54 Axcess Programming Language ...
Страница 66: ...Variable Types and Conversions 58 Axcess Programming Language ...
Страница 70: ...Two Dimensional Arrays 62 Axcess Programming Language ...
Страница 80: ...While Keywords 72 Axcess Programming Language ...
Страница 86: ...Using Buffers 78 Axcess Programming Language ...
Страница 94: ...Waits and Timer Keywords 86 Axcess Programming Language ...
Страница 102: ...Using Subroutines 94 Axcess Programming Language ...
Страница 108: ...Include Files and System_Calls 100 Axcess Programming Language ...
Страница 120: ...Compiler Error Messages 112 Axcess Programming Language ...
Страница 124: ...The External_Control Protocol 116 Axcess Programming Language ...
Страница 143: ...Index 135 Axcess Programming Language ...