Adobe ColdFusion 8

Boolean operators

Boolean, or logical, operators perform logical connective and negation operations. The operands of Boolean operators are Boolean (True/False) values. The following table describes the Boolean operators:

Operator

Description

NOT

or !

Reverse the value of an argument. For example, NOT True is False and vice versa.

AND

or &&

Return True if both arguments are True; return False otherwise. For example, True AND True is True, but True AND False is False.

OR

or ||

Return True if any of the arguments is True; return False otherwise. For example, True OR False is True, but False OR False is False.

XOR

Exclusive or: Return True if one of the values is True and the other is False. Return False if both arguments are True or both are False. For example, True XOR True is False, but True XOR False is True.

EQV

Equivalence: Return True if both operands are True or both are False. The EQV operator is the opposite of the XOR operator. For example, True EQV True is True, but True EQV False is False.

IMP

Implication: The statement A IMP B is the equivalent of the logical statement "If A Then B." A IMP B is False only if A is True and B is False. It is True in all other cases.