I'm trying to avoid Evaluate and have hit a wall. I am trying to dynamically
call column names from qResults and set the values in a QuerySetCell - val1,
val2, val3, val4, etc...
Here's an example:
cfset Monthly2003= QueryNew(month, dollar_amount)
cfset QueryAddRow(Monthly2003, 12)
cfloop
Original Message:
From: Ryan Kime [EMAIL PROTECTED]
cfloop index=LoopCount from=1 to=12
cfset QuerySetCell(Monthly2003, month, curMonth, LoopCount)
cfset QuerySetCell(Monthly2003, dollar_amount,
qResults[valLoopCount], LoopCount)
/cfloop
The second QuerySetCell is what is killing me. It
Good question Scott, the recordcount of qResults will always be 1. FYI,
adding the [1] worked!
Thanks!
-Original Message-
From: Scott Brady [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 3:05 PM
To: CF-Talk
Subject: re: Dynamic variable names in QuerySetCell
Original
If someone knows of a good Javascript list where I can ask this, let me
know and I'll go there. I'm trying to loop in Javascript and create a
dynamic variable name in each loop (the way I can do a
variablename#loopvalue# in CF.) Any idea how I could do this? I'm trying
to access form
www.irt.org is a great resource and here's a link to an answer to your
question:
http://developer.irt.org/script/809.htm
Marlon
Thane Sherrington wrote:
If someone knows of a good Javascript list where I can ask this, let me
know and I'll go there. I'm trying to loop in Javascript and
At 06:40 AM 02/10/02 -0500, Marlon Moyer wrote:
www.irt.org is a great resource and here's a link to an answer to your
question:
Thanks. That appears to have solved it.
T
~|
Archives:
Ok...I was recently sitting in a meeting with some people in my department about an
application I'm developing. Seeing as I am *the* developer I could really use some
help. It's an estimating/billing application. There is a possibility of twenty
different lines for materials used and
Here's the magic you need:
#evaluate(form.materiali)#
-Original Message-
From: Jen R [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 12:17 PM
To: CF-Talk
Subject: Dynamic Variable Names
In my database I have the fields material1, material2, material3,
material4
I know you said you tried evaluate but in this case it would seem to be the way to go.
What was the output? Did you get the syntax wrong? Why is it that evaluate didn't
work for you?
Assuming there will always be at least one material
[psuedocode - you fill in the cf tags]
sql = insert
[EMAIL PROTECTED]
Sent: Thursday, June 07, 2001 3:16 PM
Subject: Dynamic Variable Names
Ok...I was recently sitting in a meeting with some people in my department
about an application I'm developing. Seeing as I am *the* developer I could
really use some help. It's an estimating/billing
: Dynamic Variable Names
Ok...I was recently sitting in a meeting with some people in
my department about an application I'm developing. Seeing as
I am *the* developer I could really use some help. It's an
estimating/billing application. There is a possibility of
twenty different lines
Can you have dynamic variable names in CF?e.g in an action page could
you have something like -
cfset thelist =
cfloop from=1 to=3 index=id
cfset thevalue = Evaluate(form.fieldnum #id#)
cfset thelist = ListAppend(thelist, thevalue)
/cfloop
where there are form fileds
How about
cfset thelist =
cfloop from=1 to=3 index=id
cfset thelist = ListAppend(thelist, Evaluate(form.fieldnum#id#))
/cfloop
Nick
-Original Message-
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 4:23 PM
To: CF-Talk
Subject: Dynamic variable names
)
cfset thelist = ListAppend(thelist, thevalue)
/cfloop
-Original Message-
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 8:23 AM
To: CF-Talk
Subject: Dynamic variable names
Can you have dynamic variable names in CF?e.g in an action page could
you have
Email : [EMAIL PROTECTED]
ICQ UIN : 3679482
My ally is the Force, and a powerful ally it is. - Yoda
-Original Message-
From: Dylan Bromby [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 12:22 PM
To: CF-Talk
Subject: RE: Dynamic variable names
yes you can do it. i use
2:42 PM
To: CF-Talk
Subject: Dynamic Variable Names
I want to dynamically create a variable name based upon a url variable.
First I set up a couple of strings:
CFSET qs = 'q'
CFSET qn = #Insert(url.q, qs, 1)#
Where q is a number from 1-37 passed via url variable. Let's say that
url.q is 7
assuming that once you have retrieved the record the value of qn is no
significant, try alias the value in the query:
CFQUERY NAME=get_results DATASOURCE=datasource
SELECT #qn# as foo
FROM database
/CFQUERY
Jenny Anderson wrote:
I want to dynamically create a variable name based
:[EMAIL PROTECTED]]
Sent: Friday, May 04, 2001 1:38 PM
To: CF-Talk
Subject: Re: Dynamic Variable Names
assuming that once you have retrieved the record the value of qn is no
significant, try alias the value in the query:
CFQUERY NAME=get_results DATASOURCE=datasource
SELECT #qn# as foo
Meekhof [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 04, 2001 1:38 PM
To: CF-Talk
Subject: Re: Dynamic Variable Names
assuming that once you have retrieved the record the value of qn is no
significant, try alias the value in the query:
CFQUERY NAME=get_results DATASOURCE=datasource
SELECT
I want to dynamically create a variable name based upon a url variable.
First I set up a couple of strings:
CFSET qs = 'q'
CFSET qn = #Insert(url.q, qs, 1)#
Where q is a number from 1-37 passed via url variable. Let's say that
url.q is 7. Then qn is 'q7'.
So I query the database like this:
#Evaluate(qn)#
I want to dynamically create a variable name based upon a url variable.
First I set up a couple of strings:
CFSET qs = 'q'
CFSET qn = #Insert(url.q, qs, 1)#
Where q is a number from 1-37 passed via url variable. Let's say that
url.q is 7. Then qn is 'q7'.
So I query
Hi,
In this example I have two pages...with a form post inbetween.
The first page has a lot of text boxes called ID1 to ID16 (so, 16 in total
;) ).these boxes are in a database loop (thus the number to
differentiate them). Also over time the number may change from 16 to 18
etc..so there
if (field eq "Custom") {
// do this is custom
} else {
// do this if not
}
x = x + 1 ;
}
cfscript
-Original Message-
From: Martin S [mailto:[EMAIL PROTECTED]]
Sent: January 16, 2001 21:
cfset rs = SetVariable("choice" count, blah)
Does rs have any special meaning or does it not matter?
No, it's a dummy variable. It stands for "return string". In fact, as has
been pointed out before, you could omit the left side of the CFSET, and it
would still work:
cfset
What's the best way to dynamically name variables used in a
CFSET tag?
I want them named choice0, choice1, etc up through however
many loops are made:
CFSET choice#count# = blah (which does not work but
illustrates what I'm trying to do.
As many people have already pointed out, you
Does rs have any special meaning or does it not matter?
jon
cfset rs = SetVariable("choice" count, blah)
Of those two, I'd recommend the second, simply because it will be
supported
in future versions of CF, while the first one may not be.
However, you might consider using a
This code works:
cfset "choice#count#" = blah
-Original Message-
From: David Shadovitz [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 03, 2000 12:39 AM
To: CF-Talk
Subject: Re: Dynamic Variable Names in a CFSET
cfset tmp = SetVariable("choice#count#", blah)
-
Hello,
What's the best way to dynamically name variables used in a CFSET tag?
I want them named choice0, choice1, etc up through however many loops are
made:
CFSET choice#count# = blah (which does not work but illustrates what I'm
trying to do.
Thanks,
Dave
Check EVALUATE and DE functions
Gennadi
- Original Message -
From: "David Hannum" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Friday, November 03, 2000 3:06 PM
Subject: Dynamic Variable Names in a CFSET
Hello,
What's the best way to dynamically
cfset "choice#count#" = blah
-Original Message-
From: David Hannum [mailto:[EMAIL PROTECTED]]
Sent: Friday, 3 November 2000 15:06
To: CF-Talk
Subject: Dynamic Variable Names in a CFSET
Hello,
What's the best way to dynamically name variables used in a CFSET tag?
: Dynamic Variable Names in a CFSET
Hello,
What's the best way to dynamically name variables used in a CFSET tag?
I want them named choice0, choice1, etc up through however many loops are
made:
CFSET choice#count# = blah (which does not work but illustrates what I'm
trying to do.
Thanks,
Dave
Dave, you're real close. Just do
CFSET "choice#count#" = blah
There's also the SetVariable() function that can be used to do the same thing (check
the docs). I'm not sure there's much of an advantage to either way of doing it. I
believe the above example only works with CF4 and up, while
Try:
CFSET "choice#count#" = blah
Norman Elton
Information Technology
College of William Mary
-Original Message-
From: David Hannum [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 02, 2000 11:06 PM
To: CF-Talk
Subject: Dynamic Variable Names in a CFSET
Hello,
What'
cfset tmp = SetVariable("choice#count#", blah)
-David
On Thu, 2 Nov 2000 23:06:20 -0500 "David Hannum"
[EMAIL PROTECTED] writes:
Hello,
What's the best way to dynamically name variables used in a CFSET
tag?
I want them named choice0, choice1, etc up through however many
loops are
34 matches
Mail list logo