Using Logical Operators

There are two logical operators that can be used to join two sub-expressions: AND and OR. Logical operators are used in conjunction with the comparison operators to make more useful expressions. They join two comparison expressions to make a single expression.

Logical Operators

Logical Operators

Meaning

AND

Both expressions must evaluate to true.

OR

Only one of the expressions needs to evaluate to true.

As with the comparison operators, if an expression with a logical operator is evaluated and the comparison is TRUE, the value of the expression is the number 1. If the comparison is FALSE, the value of the expression is the number 0.

Logical operators can be used to join two comparison expressions to form a single compound expression. If two comparison expressions are joined by the logical operator AND, both expressions must be TRUE for the entire expression to be TRUE.

Example:

 

In an OR expression, only one of the two sub-expressions must be TRUE.

Example:

 

Related Topics

Using PracticeScript Operators

Using Functions

Using Variables