Logical Operators

Logical operators can be used on or between Boolean variable types to obtain a boolean result.

The following table lists the operators that are available in BPL:

Operator Meaning Order of Operation Evaluation Criteria
not Logical not 5 Negates the operand value so if the value is true, it becomes false and vice versa.
and Logical and 6 Yields true if and only if both operands are true. Yields false if any of the operands are false. Uses evaluation by need, so if the first operand is false, the evaluation process is stopped and the result is false.
or Logical or 7 Yields true if either operand is true. Yields false if and only if both operands are false. Uses evaluation by need, so if the first operand is true, the evaluation process is stopped and the result is true.
NOT Example:
if not found then
    // do something
end
AND Example:
if orderAmt < 200 and paymentType = "Credit" then
    // do something
end
OR Example:
if shipStatus = "Received" or shipStatus = "Pending") then
    // do something
end