Operators
49
Axcess Programming Language
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. 14 provides a pictorial explanation of the AND table.
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.
NOT is used differently than the other logical operators since it only requires one condition. For
example:
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.
FIG. 13
Sample logical expression truth tables
FIG. 14
Sample logical expression table of the operator AND
FIG. 15
Sample logical expression table to compare two conditions
Содержание 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 ...