latest reactions

David Levin
Does the trim still work if the form fie …
mal
as long as the join keys are same in eac …
Tarida
I am using ipinfodb.com to redirect the…
David Levin
Good stuff. For those interested in a UD …
PtcBux
oh Wilbur Gans wrote thank you so much…

Clicky Web Analytics
Use OpenDNS
ZERIGO DNS

Ultimate dns hosting based on pre-defined templates, DNS redirection and lot's more.

mxna feeds

CF Webtools is Hiring Full Time Remote DevelopersConnecting to JNDI data sources in ColdFusion 10Video : Security improvements in ColdFusion 10Adobe ColdFusion Webcast: Evolutions of ColdFusion and Application Predictions for 2013Resolve Stability Problems and SPEED UP ColdFusion 10Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusionNot able to apply Hotfix from ColdFusion 10 Administrator on Windows with Lockdown guide imposed on server. How to setInfinite Scroll Example with ColdFusionColdFusion Summit 2013ColdFusion Dev Needed: Albany, NYCF911: New Adobe document about #ColdFusion security hotfixes: required reading, I'd sayColdFusion Summit AnnouncedAdobe Announces ColdFusion Summit 2013Circular Thumbnails with ColdFusion / CSSColdFusion Dev needed: South Florida

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2013 mximize.com.
All right reserved.

Visit Carlos GallupaMXNA webfeed

How to set a dynamic variable name?

<cfloop from="1" to="10" index="i">
 <cfset "request.var_#i#" = i>
</cfloop>

<cfdump var="#request#">

11170 viewed | 4 opinion(s)  | del.icio.us | Digg it | Tjarko @ 13/11/02 0:00 cet


Reactions:

Eran Magen wrote.... (site)

Thanks a bunch! I've been wrestling with this for the last ~30 minutes, and a little pair of quotes was all I was missing... :-)

Take care,

- Eran

21 October 2007 6:25 cet  

Maija Johnstone wrote.... (site)

To create a dynamic variable name you need to use evaluate().This function lets you concatenate variables and/or strings to create a variable name and then evaluates that variable to its value.

12 November 2007 19:11 cet  

Tjarko wrote.... (site)

I'm sorry Maija, but you should never ever user evaluate() It's a total overload for coldfusion. The best way is the way described above, this has no impact on performance and the evaluate() function is really bad for performance. Please don't ever use this function again, or be very very sure that you absolutly have to.

12 November 2007 20:02 cet  

Cougar wrote.... (site)

simple quotes, I'm amazed.CF continues to amaze me with its power.Thank you for posting this.Your solution was the first link in Google with the following: coldfusion set variable in a variable name

16 May 2008 16:49 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!