Actually that wouldn�t work. It would create the variable in the session scope. I don't think that's what he is after. He wanted to end up with a variable called qnum2, not session.qNum2
-----Original Message----- From: Chris Peters [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 19, 2004 2:08 PM To: CF-Talk Subject: Re: Using a form field name as part of the name of a session variable This would also work (although it looks kinda strange): <cfset "session.qNum#form.qNum#" = form.answer> >>> Try this >>> >>> <cfset session["qNum#form.qNum#"] = form.answer> > >PERFECT. I never would have figured that out on my own. I mean, there's >not even a DOT after "session". Thanks. > >Sincerely, > >Andrew > > >-----Original Message----- >From: Ewok [mailto:[EMAIL PROTECTED] >Sent: Tuesday, October 19, 2004 12:40 PM >To: CF-Talk >Subject: RE: Using a form field name as part of the name of a session >variable > >Try this > ><cfset session["qNum#form.qNum#"] = form.answer> > >Or something like that... maybe without quotes? But I think with. > > >-----Original Message----- >From: Peterson, Andrew S. [mailto:[EMAIL PROTECTED] >Sent: Tuesday, October 19, 2004 1:23 PM >To: CF-Talk >Subject: Using a form field name as part of the name of a session >variable > >Hi, > >I'm hoping this is just a question of syntax. Is it possible to set part >of the name of a session variable using the name of a form variable? The >form name is dynamic too. Here's the code that ain't working: > ><cfset session.qNum#form.qNum# = form.answer> > ^^^^^^^^^ >For example, what I'd like to set in the above line of code is a session >variable named "qNum2", or whatever value "form.qNum" is. > >If this doesn't work, I can always hard code it using a 1000 line >cfswitch block, but no one (me most of all) wants to see that :-) > >Thanks in advance. > >Sincerely, > >Andrew ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.houseoffusion.com/banners/view.cfm?bannerid=11 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:181907 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

