Evaluates one or more string expressions, dynamically, from left to right. (The results of an evaluation on the left can have meaning in an expression to the right.) Returns the result of evaluating the rightmost expression.

evaluate(expression) → returns any

Discouraged: In almost all cases evaluate is unnecessary (use bracket notation instead). Use of evaluate can lead to performance and security issues.

Argument Reference

expression string

Expression to evaluate. String expressions can be complex. If a string expression contains a single- or double-quotation mark, the mark must be escaped. This function is useful for forming one variable from multiple variables.

Links more information about evaluate

Sample code invoking the evaluate function

<!--- Evaluate the expression ---> 
 <cfset first = "ColdFusion"> 
 <cfset second = "ColdFusion"> 
 <cfset op = "eq"> 
 <cfoutput>#evaluate("first #op# second")#</cfoutput> 

Expected Result: YES

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub