Adobe COLDFUSION 9 Manual page 80

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Using dynamic evaluation
Dynamic evaluation and dynamic expressions have several features and consideratons.
ColdFusion dynamic evaluation functions
The following table describes the functions that perform dynamic evaluation and are useful in evaluating dynamic
expressions:
Function
DE
Evaluate
IIf
PrecisionEvaluate
SetVariable
Function argument evaluation considerations
It is important to remember that ColdFusion always evaluates function arguments before the argument values are
passed to a function:
For example, consider the following
<cfoutput>#DE("1" & "2")#</cfoutput>
You might expect this line to display """1"" & ""2""". Instead, it displays "12", because ColdFusion processes the line as
follows:
Evaluates the expression "1" & "2" as the string "12".
1
2
Passes the string "12" (without the quotation marks) to the
Calls the
function, which adds literal quotation marks around the 12.
3
DE
Similarly, if you use the expression DE(1 + 2), ColdFusion evaluates 1 + 2 as the integer 3 and passes it to the function.
The function converts it to a string and surrounds the string in literal quotation marks: "3".
About the Evaluate function
The
function takes one or more string expressions, dynamically evaluates their contents as expressions from
Evaluate
left to right, and returns the result of evaluating the rightmost argument.
Purpose
Escapes any double-quotation marks in the argument and wraps the result in double-quotation marks. The
function is particularly useful with the
DE
be output.
For an example of using the
function with the
DE
Takes one or more string expressions and dynamically evaluates their contents as expressions from left to
right. (The results of an evaluation to the left can have meaning in an expression to the right.) Returns the
result of evaluating the rightmost argument.
For more information on this function see
Evaluates a Boolean condition expression. Depending on whether this expression is True or False,
dynamically evaluates one of two string expressions and returns the result of the evaluation. The
function is convenient for incorporating a
For an example of using this function, see
Operates identically to the
Evaluate
arithmetic. If one or more operands in an arithmetic expression are decimal numbers, such as
12947834.986532, and are too long to be represented exactly by a ColdFusion numeric data type, the
function uses arbitrary-precision arithmetic to calculate the result, and return the result as an arbitrarily
long string of numbers. For more information about this function, see PrecisionEvaluate in the CFML
Reference.
Sets a variable identified by the first argument to the value specified by the second argument. This function
is no longer required in well-formed ColdFusion pages; see
page 78.
function:
DE
Last updated 8/5/2010
function, to prevent the function from evaluating a string to
IIF
function, see
"Using the IIF
IIF
"About the Evaluate
function" on page 75.
cfif
tag in line in HTML.
"Using the IIF
function" on page 78.
function, except that it can calculate arbitrary precision decimal
"SetVariable function
function.
DE
75
function" on page 78.
IIF
considerations" on

Advertisement

Table of Contents
loading

Table of Contents