thanks! this worked:

<cfset variables.structVarName = "myStruct" />

<cfset "#structVarName#" = StructNew()/>

<cfset keyVariable = "steven.ross" />
<cfset theValue = "a name" />

<cfdump var="#Evaluate(structVarName)#">

<cfset variables[structVarName][keyVariable] =  theValue />

<cfdump var="#Evaluate(structVarName)#">

On 3/5/07, Gurevich, Gerry (NIH/NIEHS) [C] <[EMAIL PROTECTED]> wrote:
Well I would want to ask and argue not to do this...but I'll bite my
tongue.

Why not create a superstructure to hold this.  Then you could do
something like:
<cfset superstruct=structnew()>
<cfset structVarName = "myStruct" />

<cfset superstruct[structVarName] = StructNew()/>

<cfset keyVariable = "steven.ross" />
<cfset theValue = "a name" />

<cfset superstruct[structVarName][keyVariable] = theValue />

I have not tested this, but it should be close to right.

Come to think of it, you might even see if you could use "variables"
instead of the superstruct.  I think that might work.


------------------------------------
Gerry Gurevich
Application Development
NIEHS ITSS Contractor
Lockheed Martin Information Technology
919-361-5444 ext 311


-----Original Message-----
From: Steven Ross [mailto:[EMAIL PROTECTED]
Sent: Monday, March 05, 2007 4:21 PM
To: ACFUG ColdFusion Discussion
Subject: [ACFUG Discuss] dynamic structs/variable

ok so for whatever reason (I'd rather not hear arguments why not to do
this) I want to try to do this:

<cfset structVarName = "myStruct" />

<cfset "#structVarName#" = StructNew()/>

<cfset keyVariable = "steven.ross" />
<cfset theValue = "a name" />

<cfset structVarName[keyVariable] = theValue />

the last part is the part I can't get to work... tired all sorts of
flavors of evaluate, and I would have included a few examples of what
I have tried but, figured that would confuse the issue. Any help would
be appreciated.

-Steven


--
Steven Ross
web application & interface developer
http://www.zerium.com
[mobile] 404-488-4364
[fax] 267-482-4364


-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------




-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?falogin.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------






--
Steven Ross
web application & interface developer
http://www.zerium.com
[mobile] 404-488-4364
[fax] 267-482-4364


-------------------------------------------------------------
To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to