View comments | RSS feed
Contents > Developing ColdFusion MX Applications > Using Expressions and Pound Signs > Expressions > Operator types Boolean operators PreviousNext

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

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

AND

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

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.


Contents > Developing ColdFusion MX Applications > Using Expressions and Pound Signs > Expressions > Operator types Boolean operators PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


No screen name said on Oct 29, 2004 at 12:12 PM :
Will CF evaluate both sides of a boolean AND expression if the first part is false? (short-circuiting). I remember reading this somewhere, but it seems to me that it should be more visible in the docs.
No screen name said on Jan 28, 2005 at 12:15 PM :
I was wondering about short-circuiting as well, since older versions of CF did not (requiring some rather annoyingly redundant nested CFIF structures.)

I just tested AND and OR with ColdFusion MX 6.1, and it does use short-circuit evaluation. So CFIF A AND B will not bother to evaluate B if A is false, and CFIF A OR B will not bother to evauate B if A is true.
howbizrami said on Aug 20, 2007 at 2:28 PM :
According to this post, although it doesn't give a version, it does short-circuit.
http://www.adobepress.com/articles/article.asp?p=28686&rl=1

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/expresa5.htm