View comments | RSS feed
Contents > Developing ColdFusion MX Applications > Using Expressions and Pound Signs > Dynamic expressions and dynamic variables > About dynamic expressions and dynamic evaluation Selecting how to create variable names PreviousNext

Selecting how to create variable names

The following two examples describes cases when you need dynamic variable names:

In both cases, it might appear that dynamic expressions using the Evaluate function are needed to construct the variable names. However, you can achieve the same ends more efficiently by using dynamic variable naming, as shown in Example: a dynamic shopping cart.

This does not mean that you must always avoid dynamic evaluation. However, given the substantial performance costs of dynamic evaluation, you should first ensure that one of the following techniques cannot serve your purpose:


Contents > Developing ColdFusion MX Applications > Using Expressions and Pound Signs > Dynamic expressions and dynamic variables > About dynamic expressions and dynamic evaluation Selecting how to create variable names 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.

Comments


imstillatwork said on Nov 19, 2005 at 5:09 PM :
For example, you should reference form variables as the structure that they are when you are dynamically creating an unknown number of input fields.

#form["name_" & i]#

rather then building a string and using evaluate...

 

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

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