Logical Operators - AMX AXCESS CONTROL SYSTEM PROGRAM Instruction Manual

Programming language
Table of Contents

Advertisement

Logical Operators

Logical operators, or Boolean operators, like relational operators produce either true or false result.
Instead of using greater or less than signs, logical operators use the following keywords:
The following example demonstrates its use.
DEFINE_PROGRAM
X = 5
Y = 1
IF ((X = 5) AND (Y = 4))
{
SEND_STRING Ø,"'THIS STATEMENT NEVER GETS EXECUTED',$ØD,$ØA"
}
ELSE
{
SEND_STRING Ø,"'THIS STATEMENT DOES GET EXECUTED',$ØD,$ØA"
}
FIG. 13 provides a quick reference guide for the results of a logical expression.
FIG. 13 Sample logical expression truth tables
FIG. 14 provides a pictorial explanation of the AND table.
FIG. 14 Sample logical expression table of the operator AND
FIG. 15 shows a sample logical expression table comparing two conditions. Since both (X = 5) and
(Y = 4) are not true, the result of the expression is false and Statement 2 is executed. If both
conditions had been true, Statement 1 would be executed instead.
FIG. 15 Sample logical expression table to compare two conditions
NOT is used differently than the other logical operators since it only requires one condition. For
example:
Axcess Programming Language
AND Both conditions 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 condition can be true for the result to be true.
NOT This keyword uses only one condition. If this condition is true, the result is false; if the condi-
tion is false, the result is true.
Operators
49

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AXCESS CONTROL SYSTEM PROGRAM and is the answer not in the manual?

This manual is also suitable for:

Axcess

Table of Contents