I believe there is a function in CF called SetVariable that will allow you
to create custom vars.
-Original Message-
From: Paul Mone [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 15, 2000 11:58 PM
To: CF-Talk
Subject: RE: append variable to a variable??
You can use evaluate
CFSET "var#num#" = num
It's beautiful.
Lee (Bjork) Borkman
http://bjork.net ColdFusion Tags by Bjork
IMPORTANT NOTICE:
This e-mail and any attachment to it is intended only to be read or used by
the named addressee. It is confidential and may contain legally privileged
information. No
ber 17, 2000 5:17 AM
Subject: Re: append variable to a variable??
Excellent question that I wouldnt mind knowing an answer to myself.
Anyone?
From: Rob Keniger [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Subject: Re: append variable to a variable??
Date: Fr
Excellent question that I wouldnt mind knowing an answer to myself. Anyone?
From: Rob Keniger [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Subject: Re: append variable to a variable??
Date: Fri, 17 Nov 2000 14:31:52 +1000
on 17/11/00 10:19 AM, BORKMAN Lee
Aidan,
I wonder why you tried the ugly version first. Forget the ampersands, forget
SetVariable. Maybe forget the vairables scoping as well. Just do this:
CFSET "variables.abc#Evaluate(somevalue + 1)#" = "whatever"
Now doesn't that look much MUCH nicer than this:
CFSET variables.Result =
Using SetVariable is better
cfset setvariable("Edname" numvar, "test")
I disagree.
Why is it "better"? SetVariable is just another redundant function to
learn, another syntax to look up. I believe there actually IS some
circumstance where you MUST use it, but I just can't recall
Thanks Everyone!!
Sal
From: "Andrew" [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Subject: RE: append variable to a variable??
Date: Wed, 15 Nov 2000 22:40:23 -0500
Sal:
Sure there is. try this for instance:
cfset numvar = "2"
Using SetVariable is better
cfset setvariable("Edname" numvar, "test")
Justin
-Original Message-
From: S R [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 16, 2000 5:29 PM
To: CF-Talk
Subject: RE: append variable to a variable??
Thanks Everyone!!
Sal
F
I disagree.
Why is it "better"? SetVariable is just another redundant function to
learn, another syntax to look up. I believe there actually IS some
circumstance where you MUST use it, but I just can't recall when.
CFSET "edname#numvar#" = "test" does exactly what you would expect and
hope.
on 17/11/00 10:19 AM, BORKMAN Lee at [EMAIL PROTECTED] wrote:
As with most languages, you only need to use 50% (or even less) of a CF's
functions to do 99% of the stuff that you would ever want to do.
Coincidentally, using just that 50% makes your code easier to work with for
other average
Yes, I believe that IncrementValue IS faster, but I'm not going to use it
except where I need to squeeze the last millisecond from a heavily-used
piece of code.
Comprehensibility + readabaility = maintainability + reliabaility, or
something like that.
Lee (Bjork) Borkman
http://bjork.net
Is there anyway to do this?
I have six variables in my database they are called:
EdName1, EdName2, etc.
It would be awesome if I could set a variable that could dynamically change
the number of each variable for me so I don't have to hard code the
variable.
For example (I know this doesn't
Message-
From: S R [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 15, 2000 7:56 PM
To: CF-Talk
Subject: append variable to a variable??
Is there anyway to do this?
I have six variables in my database they are called:
EdName1, EdName2, etc.
It would be awesome if I could set a variable
I haven't done this in a while, but I believe this is the correct syntax...
CFSET "edname#numvar#" = "value"
___
Justin Scott :: [Staff Developer]
http://www.annex.com
EdName1, EdName2, etc.
It would be awesome if I could set a variable that could
loop
However you cannot use it on the left side of an experssion, i.e
THIS WONT WORK
cfset evaluate("EdName" 1) = "test"
/THIS WONT WORK
Maybe you should use an array.
-Original Message-
From: S R [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 15, 2000 4:5
Wow, I didn't know you could do that. thanks.
-Original Message-
From: Andrew [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 15, 2000 7:40 PM
To: CF-Talk
Subject: RE: append variable to a variable??
Sal:
Sure there is. try this for instance:
cfset numvar = "2&q
cfloop index="x" from="1" to="5"
cfoutput#evaluate('Edname#x#')#/cfoutput
/cfloop
-Original Message-
From: S R [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 15, 2000 4:56 PM
To: CF-Talk
Subject: append variable to a variable??
Is there
17 matches
Mail list logo