naming a variable from another...

2003-08-21 Thread Ryan Mitchell
Hello

I need to name a variable using the value of another variable in the name...

Eg

I have a variable called id and I want to do this

cfset newvariable_#id# = value

But it won't let me :)
How do you do this?

TIA,
Ryan

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm


RE: naming a variable from another...

2003-08-21 Thread DURETTE, STEVEN J (AIT)
Try cfset newvariable_#id# = value

Steve


-Original Message-
From: Ryan Mitchell [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 7:51 AM
To: CF-Talk
Subject: naming a variable from another... 


Hello

I need to name a variable using the value of another variable in the name...

Eg

I have a variable called id and I want to do this

cfset newvariable_#id# = value

But it won't let me :)
How do you do this?

TIA,
Ryan


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm


RE: naming a variable from another...

2003-08-21 Thread Raymond Camden
In MX, you can do

cfset variables[foo] = value

Where foo is ID, this will make variables.id equal to value.

Before MX, you can use evaluate

cfset foo = id
cfset evaluate(#foo#=1)
cfoutput#id#/cfoutput

Although this is icky. ;) If I needed to set a bunch of dynamically
named vars prior to MX, I'd just make a struct:

cfset mycrap = structNew()

cfset mycrap[foo] = value


===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email: [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

My ally is the Force, and a powerful ally it is. - Yoda 

 -Original Message-
 From: Ryan Mitchell [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, August 21, 2003 5:51 AM
 To: CF-Talk
 Subject: naming a variable from another... 
 
 
 Hello
 
 I need to name a variable using the value of another variable 
 in the name...
 
 Eg
 
 I have a variable called id and I want to do this
 
 cfset newvariable_#id# = value
 
 But it won't let me :)
 How do you do this?
 
 TIA,
 Ryan
 
 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm


Re: naming a variable from another...

2003-08-21 Thread Stephen Moretti
cfset setvariable(newvariableid,value)
which reads better in cfscript

or

cfset variables[newvariableid] = value

umm... I'm sure there are other ways too, just don't use evaluate()  ;o)

Stephen

- Original Message - 
From: Ryan Mitchell [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 12:50 PM
Subject: naming a variable from another...


 Hello

 I need to name a variable using the value of another variable in the
name...

 Eg

 I have a variable called id and I want to do this

 cfset newvariable_#id# = value

 But it won't let me :)
 How do you do this?

 TIA,
 Ryan



~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm


RE: naming a variable from another...

2003-08-21 Thread Pascal Peters
cfset newvariable_#id# = value

-Oorspronkelijk bericht- 
Van: Ryan Mitchell [mailto:[EMAIL PROTECTED] 
Verzonden: do 21/08/2003 13:50 
Aan: CF-Talk 
CC: 
Onderwerp: naming a variable from another... 



Hello

I need to name a variable using the value of another variable in the name...

Eg

I have a variable called id and I want to do this

cfset newvariable_#id# = value

But it won't let me :)
How do you do this?

TIA,
Ryan


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm


RE: naming a variable from another...

2003-08-21 Thread Sarsoun, Jeff
Take a look at the setVariable() function.

Jeff Sarsoun
-Original Message-
From: Ryan Mitchell [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 7:51 AM
To: CF-Talk
Subject: naming a variable from another... 


Hello

I need to name a variable using the value of another variable in the name...

Eg

I have a variable called id and I want to do this

cfset newvariable_#id# = value

But it won't let me :)
How do you do this?

TIA,
Ryan


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm


RE: naming a variable from another...

2003-08-21 Thread Sarsoun, Jeff
You wouldn't even need the evaluate for this.

cfset setVariable('newvariable'  id,value)

Jeff Sarsoun

-Original Message-
From: Michael T. Tangorre [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 10:02 AM
To: CF-Talk
Subject: Re: naming a variable from another... 


Try this..

SetVariable(Evaluate('newvariable'  id),value)

Mike

- Original Message - 
From: Ryan Mitchell [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 7:50 AM
Subject: naming a variable from another...


 Hello

 I need to name a variable using the value of another variable in the
name...

 Eg

 I have a variable called id and I want to do this

 cfset newvariable_#id# = value

 But it won't let me :)
 How do you do this?

 TIA,
 Ryan

 

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


naming a variable from another...

2003-08-21 Thread Mike Mertsock
Hi Ryan,

You have lots of options:

cfset newvariable_#id# = value
or
cfset SetVariable( newvariable_#id#, value )

...and I am sure there are plenty more options out there. Of the two choices above, 
the first one is the best-performing.

Good day
Mike Mertsock
Alfred University Web Team

Hello

I need to name a variable using the value of another variable in the name...

Eg

I have a variable called id and I want to do this

cfset newvariable_#id# = value

But it won't let me :)
How do you do this?

TIA,
Ryan
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm


RE: naming a variable from another...

2003-08-21 Thread d.a.collie
cfset newvariable_#id# = value

-Original Message-
From: Ryan Mitchel
Sent: 21 August 2003 12:51
To: CF-Talk
Subject: naming a variable from another... 


Hello

I need to name a variable using the value of another variable in the
name...

Eg

I have a variable called id and I want to do this

cfset newvariable_#id# = value

But it won't let me :)
How do you do this?
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


Re: naming a variable from another...

2003-08-21 Thread Michael T. Tangorre
Try this..

SetVariable(Evaluate('newvariable'  id),value)

Mike

- Original Message - 
From: Ryan Mitchell [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 7:50 AM
Subject: naming a variable from another...


 Hello

 I need to name a variable using the value of another variable in the
name...

 Eg

 I have a variable called id and I want to do this

 cfset newvariable_#id# = value

 But it won't let me :)
 How do you do this?

 TIA,
 Ryan

 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


RE: naming a variable from another...

2003-08-21 Thread Patricia G. L. Hall
 In MX, you can do

 cfset variables[foo] = value

 Where foo is ID, this will make variables.id equal to value.

 Before MX, you can use evaluate

 cfset foo = id
 cfset evaluate(#foo#=1)
 cfoutput#id#/cfoutput

 Although this is icky. ;)

Icky?  Ah, a technical term.  jk

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm