ColdFusion dynamic evaluation functions

The following table describes the functions that perform dynamic evaluation and are useful in evaluating dynamic expressions:

Function

Purpose

DE

Escapes any double-quotation marks in the argument and wraps the result in double-quotation marks. The DE function is particularly useful with the IIF function, to prevent the function from evaluating a string to be output.

For an example of using the DE function with the IIF function, see Using the IIF function.

Evaluate

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 About the Evaluate function.

IIf

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 IIF function is convenient for incorporating a cfif tag in line in HTML.

For an example of using this function, see Using the IIF function.

PrecisionEvaluate

Operates identically to the Evaluate function, except that it can calculate arbitrary precision decimal 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.

SetVariable

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 SetVariable function considerations.