
68
DEVELOPING
COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Las
t
upda
te
d 8/5/2010
The parentheses can contain any expression that evaluates to a Boolean value, and
a
and
b
can be any valid expression.
You can nest this operator inside other expressions.
Operator precedence and evaluation ordering
The order of precedence controls the order in which operators in an expression are evaluated. The order of precedence
is as follows. (Some alternative names for operators, such as EQUALS and GREATER THAN OR EQUAL TO are
omitted for brevity.)
Unary +, Unary -
^
*, /
\
MOD
+, -
&
EQ, NEQ, LT, LTE, GT, GTE, CONTAINS, DOES NOT CONTAIN, ==, !=, >, >=, <, <=
NOT, !
AND, &&
OR, ||
XOR
EQV
IMP
To enforce a nonstandard order of evaluation, parenthesize expressions. For example:
•
6 - 3 * 2 is equal to 0
•
(6 - 3) * 2 is equal to 6
You can nest parenthesized expressions. When in doubt about the order in which operators in an expression are
evaluated, use parentheses to force the order of evaluation.
Using functions as operators
Functions are a form of operator. Because ColdFusion functions return values, you can use function results as
operands. Function arguments are expressions. For example, the following are valid expressions:
•
Rand()
•
UCase("This is a text: ") & ToString(123 + 456)
Function syntax
The following table shows function syntax and usage guidelines:
Usage
Example
No arguments
Function()
Basic format
Function(Data)
Nested functions
Function1(Function2(Data))
Multiple arguments
Function(Data1, Data2, Data3)
String arguments
Function('This is a demo')
Function('This is a demo')
Arguments that are expressions
Function1(X*Y, Function2("Text"))
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...