Function Syntax; Optional Arguments In Functions - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

580
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.
Function Syntax Guidelines
Usage
The exception — no arguments
Basic format
Nesting functions
Separate multiple arguments with
commas
Enclose string arguments in single
or double quotes
Arguments are expressions
To learn how to insert functions in various types of expressions see

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".
Example
Function()
Function(Data)
Function1(Function2(Data))
Function(data1, data2, data3)
Function('This is a demo') Function("This
is a demo")
Function1(X*Y, Function2("Text"))
CFML Language Reference
Pound
Signs.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Coldfusion 4.5

Table of Contents