IF and the Boolean Expressions
SELECT
{
ACTIVE (condition) : (*statement*)
ACTIVE (condition) : (*statement*)
ACTIVE (condition) : (*statement*)
ACTIVE (1) :
}
Here, the last ACTIVE will always be true, and will execute only if all of the conditions of the
previous ACTIVES are false. This makes the last ACTIVE's statement the default statement.
More Boolean operators
The previously discussed IF and IF...ELSE statements could only base the program flow on one
condition. However, you can combine two of these conditions with a Boolean (or relational)
operator. The Boolean operator sets the conditions for the end result.
The Boolean operators used in the Axcess Control System are AND, OR, XOR, and NOT. For
information on Boolean operators, refer to Relational Operators on page 47.
If the end result of the Boolean expression is true, Axcess continues with Statement 1. If the end
result is false, Axcess ignores Statement 1.
Reading a Boolean expression table
In most Boolean expressions, the possible conditions of two statements are analyzed to achieve one
result. These results can be visualized using Boolean expression tables, as shown in FIG. 20.
FIG. 20 Pictorial explanation of the Boolean expression table for the operator AND.
The following text formula can also be followed to find that result:
If <STATEMENT 1> is <its condition (true or false)> <Boolean operator> <STATEMENT
2> is <its condition>, then the result of the expression is <result of statement
conditions>.
The result is found by basing the conditions of the statements against specific rules set by the
Boolean operator:
For example, assume that it has been previously defined that NUM1 = 5 and NUM2 = 3. Insert the
variables from the example into the text formula:
If NUM1 = 5 is true and NUM2 = 4 is false, then the result of the
expression is false.
The statement would have been true if NUM2 had been equal to 3, because in an AND expression
both statements must be true as shown in FIG. 21.
66
(*default statement*)
AND Both statements must be true for the result to be true.
OR
At least one of the conditions must be true for the result to be true.
XOR Only one statement can be true for the result to be true.
NOT If the statement is true, the result is false. On the contrary, if the condition is false, the result
is true. This expression uses only one statement.
Axcess Programming Language
Need help?
Do you have a question about the AXCESS CONTROL SYSTEM PROGRAM and is the answer not in the manual?