User Guide

580 CFML Language Reference
XOR
EQV
IMP
To enforce a specific non-standard order of evaluation, you must parenthesize
expressions. For example:
6 - 3 * 2 is equal to 0
(6 - 3) * 2 is equal to 6
Parenthesized expressions can be arbitrarily nested. When in doubt about the order in
which operators in an expression will be evaluated, always use parentheses.
Function Syntax
The following table illustrates function syntax and usage guidelines.
To learn how to insert functions in various types of expressions see Pound Signs.
Optional arguments in functions
Some functions may take optional arguments after their required arguments. If
omitted, optional arguments take some default value. For example:
Replace("FooFoo", "Foo", "Boo") returns "BooFoo"
Replace("FooFoo", "Foo", "Boo", "ALL") returns "BooBoo"
The difference in behavior is explained by the fact that the Replace function takes an
optional fourth argument which specifies the scope of replacement. The default value
is “ONE” which explains why only the first occurrence of “Foo” was replaced with
“Boo”. In the second example, a fourth argument is provided that forces the function to
replace all occurrences of “Foo” with “Boo”.
Function Syntax Guidelines
Usage Example
The exception — no arguments
Function()
Basic format
Function(Data)
Nesting functions
Function1(Function2(Data))
Separate multiple arguments with
commas
Function(data1, data2, data3)
Enclose string arguments in single
or double quotes
Function(’This is a demo’) Function("This
is a demo")
Arguments are expressions
Function1(X*Y, Function2("Text"))