Both relational operators and logical operators compare two values and produce a result that is called a condition. With logical operators, there is a related action for each possible outcome of the condition. If the condition is true, then a specific action is taken. If the condition is false, then an alternate action is performed. For information on the order in which logical operators are evaluated, see the Order of Precedence.

The following example describes the function of the logical operator.

Example

You are reading the newspaper one morning and find that it is going to be a beautiful day. You say to yourself, "If it gets warmer than 80F and I do not have to work, then I will go to the beach."

You have just used a logical operator to define two conditions. Your first condition is that the temperature must be greater than 80F. Your second condition tests if you have to work. Both conditions must be true in order for you to go to the beach. If one condition is not true, then you will not go to the beach.

PPCL supports the following logical operators:

  • And (.AND.)
  • Not And (.NAND.)
  • Or (.OR.)
  • Exclusive Or (.XOR.)