Contents > Developing ColdFusion MX Applications > Using Expressions and Pound Signs > Expressions > Using functions as operators Expression evaluation and functions PreviousNext

Expression evaluation and functions

It is important to remember that ColdFusion evaluates function attributes as expressions before it executes the function. As a result, you can use any ColdFusion expression as a function attribute. For example, consider the following lines:

<cfset firstVariable = "we all need">
<cfset myStringVar = UCase(firstVariable & " more sleep!")>

When ColdFusion server executes the second line, it does the following:

  1. Determines that there is an expression with a string concatenation.
  2. Evaluates the firstVariable variable as the string "we all need".
  3. Concatenates "we all need" with the string " more sleep!" to get "we all need more sleep!".
  4. Passes the string "we all need more sleep!" to the UCase function.
  5. Executes the UCase function on the string argument "we all need more sleep!" to get "WE ALL NEED MORE SLEEP!".
  6. Assigns the string value "WE ALL NEED MORE SLEEP!" to the variable myStringVar.

ColdFusion completes steps 1-3 before invoking the function.


Contents > Developing ColdFusion MX Applications > Using Expressions and Pound Signs > Expressions > Using functions as operators Expression evaluation and functions PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/exprea12.htm