evaluate

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.

evaluate Argument Reference

expression string
Required

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

Examples 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


Fork me on GitHub