22.08.2013 Views

ColdFusion Developer's Guide

ColdFusion Developer's Guide

ColdFusion Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta<br />

■ When <strong>ColdFusion</strong> evaluates an expression that contains a decision operator other than<br />

CONTAINS or DOES NOT CONTAIN, it first determines if the data can be converted<br />

to numeric values. If they can be converted, it performs a numeric comparison on the<br />

data. If they cannot be converted, it performs a string comparison. This can sometimes<br />

result in unexpected results. For more information on this behavior, see “Evaluation and<br />

type conversion issues” on page 68.<br />

■ When <strong>ColdFusion</strong> evaluates an expression with CONTAINS or DOES NOT<br />

CONTAIN it does a string comparison. The expression A CONTAINS B evaluates to<br />

True if B is a substring of A. Therefore an expression such as the following evaluates as<br />

True:<br />

123.45 CONTAINS 3.4<br />

■ When a <strong>ColdFusion</strong> decision operator compares strings, it ignores the case. As a result, the<br />

following expression is True:<br />

"a" IS "A"<br />

■ When a <strong>ColdFusion</strong> decision operator compares strings, it evaluates the strings from left<br />

to right, comparing the characters in each position according to their sorting order. The<br />

first position where the characters differ determines the relative values of the strings. As a<br />

result, the following expressions are True:<br />

"ab" LT "aba"<br />

"abde" LT "ac"<br />

String operators<br />

String operators manipulate strings of characters. The following table describes the operators:<br />

Operator Description<br />

& Concatenates strings.<br />

&= Compound concatenation. The variable on the right is used as both an<br />

element in the concatenation operation and the result variable. Thus, the<br />

expression a &= b is equivalent to a = a & b.<br />

An expression can have only one compound assignment operator.<br />

NOTE<br />

In a Query of Queries, you use || as the concatenation operator.<br />

Expressions 89

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!