Re: Evaluate vs ?

2006-04-20 Thread Russ Michaels
- From: Charles Sheehan-Miles [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Date: Wed, 19 Apr 2006 23:19:13 -0400 Subject: Re: Evaluate vs ? I'm going to have to do some serious thinking about this. Performance on the mailer is a lot slower than I'd like, and I suspect its because I'm

Re: Evaluate vs ?

2006-04-20 Thread Claude Schneegans
Performance on the mailer is a lot slower than I'd like, and I suspect its because I'm using evaluate. Here is a test I made on my develop system (3000 MHz): CFSET myStruct = structNew () CFSET myStruct.myvar = test CFSET start = GetTickCount() CFLOOP INDEX=i FROM=1 TO=10 CFSET test =

Re: Evaluate vs ?

2006-04-20 Thread Aaron Rouse
I think that bites more people than not in regards to optimization. On 4/20/06, Claude Schneegans [EMAIL PROTECTED] wrote: There are many other places to look for optimization, the first being queries and correct indexes in the database.

Re: Evaluate vs ?

2006-04-20 Thread Charles Sheehan-Miles
. BTW, if your sending out that much mail, I hope you have a dedicated SMTP server and are not using the SMTP on IIS. Russ -Original Message- From: Charles Sheehan-Miles [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Date: Wed, 19 Apr 2006 23:19:13 -0400 Subject: Re: Evaluate

RE: Evaluate vs ?

2006-04-19 Thread Russ Michaels
) Michaels -Original Message- From: Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Date: Tue, 18 Apr 2006 13:30:08 -0700 Subject: RE: Evaluate vs ? Ok, guess I am missing something here: cfset foo = fee fi fo fum #variable

Re: Evaluate vs ?

2006-04-19 Thread Charles Sheehan-Miles
-Original Message- From: Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Date: Tue, 18 Apr 2006 13:30:08 -0700 Subject: RE: Evaluate vs ? Ok, guess I am missing something here: cfset foo = fee fi fo fum #variable

RE: Evaluate vs ?

2006-04-18 Thread Jochem van Dieten
Dave Watts said: What's the matter with using evaluate? It's generally more expensive to tell the computer to treat a literal string as an expression, than to just give the computer an expression in the first place. I think the bigger issue is the question where that string expression

Re: Evaluate vs ?

2006-04-18 Thread Nick Tong - TalkWebSolutions.co.uk
a bit late on this post, but heres another example: http://www.succor.co.uk/index.cfm/2006/4/13/Avoid-evaluate-always On 18/04/06, Dave Watts [EMAIL PROTECTED] wrote: What's the matter with using evaluate? It's generally more expensive to tell the computer to treat a literal string as an

RE: Evaluate vs ?

2006-04-18 Thread Lee.S.Surma
How would you fix this one? Cfset Month1 = 0101 Cfset Month2 = 0102 Cfset Month3 = 0103 Cfloop from=1 to=3 index=i cfset CMonth = Month i cfset CCMonth = #Evaluate(CMonth)# /cfloop Lee Surma ~| Message:

RE: Evaluate vs ?

2006-04-18 Thread Jochem van Dieten
How would you fix this one? Cfset Month1 = 0101 Cfset Month2 = 0102 Cfset Month3 = 0103 Cfloop from=1 to=3 index=i cfset CMonth = Month i cfset CCMonth = #Evaluate(CMonth)# /cfloop cfset CCMonth = variables[Month i] Jochem

Re: Evaluate vs ?

2006-04-18 Thread Charlie Griefer
cfset cmonth = variables[month i] / then no need for CMonth On 4/18/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How would you fix this one? Cfset Month1 = 0101 Cfset Month2 = 0102 Cfset Month3 = 0103 Cfloop from=1 to=3 index=i cfset CMonth = Month i cfset CCMonth =

RE: Evaluate vs ?

2006-04-18 Thread Everett, Al \(NIH/NIGMS\) [C]
cfset Month1 = 0101 cfset Month2 = 0102 cfset Month3 = 0103 cfloop from=1 to=3 index=i cfset CCMonth = variables[Month i] /cfloop -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 18, 2006 10:20 AM To: CF-Talk Subject: RE: Evaluate vs

Re: Evaluate vs ?

2006-04-18 Thread Rob Wilkerson
variables['cMonth' i] (assuming the variables scope, of course) On 4/18/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How would you fix this one? Cfset Month1 = 0101 Cfset Month2 = 0102 Cfset Month3 = 0103 Cfloop from=1 to=3 index=i cfset CMonth = Month i cfset CCMonth =

RE: Evaluate vs ?

2006-04-18 Thread Loathe
# /cfloop What's the expected outcome, or output? -- Timothy Heald Analyst, Architect, Developer [EMAIL PROTECTED] W: 202-228-8372 C: 703-300-3911 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 18, 2006 10:20 AM To: CF-Talk Subject: RE: Evaluate vs

RE: Evaluate vs ?

2006-04-18 Thread Ben Nadel
PROTECTED] Sent: Tuesday, April 18, 2006 10:24 AM To: CF-Talk Subject: Re: Evaluate vs ? variables['cMonth' i] (assuming the variables scope, of course) On 4/18/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How would you fix this one? Cfset Month1 = 0101 Cfset Month2 = 0102 Cfset Month3 = 0103

Re: Evaluate vs ?

2006-04-18 Thread Matt Williams
What about this one: cfloop collection=struct_Params item=theKey cfset Evaluate(myObject.set#theKey#(struct_Params.#theKey#) / /cfloop Basically it is calling a setter method based on what is in the a structure. The cfset would evaluate to myObject.setFirstName('Matt')

Re: Evaluate vs ?

2006-04-18 Thread Charlie Griefer
cfset myObject['set' theKey](struct_Params[theKey]) / ^ untested :) On 4/18/06, Matt Williams [EMAIL PROTECTED] wrote: What about this one: cfloop collection=struct_Params item=theKey cfset Evaluate(myObject.set#theKey#(struct_Params.#theKey#) / /cfloop Basically it is calling a setter

RE: Evaluate vs ?

2006-04-18 Thread Lee.S.Surma
Not sure what you're going for here, the above could be used in about the same way or something like this: My example was altered and simplified. It goes to 12. Variables worked and speeded the page load slightly. Some of the other object type examples are intriguing. Lee Surma

Re: Evaluate vs ?

2006-04-18 Thread Matt Williams
Charlie, It didn't like that. Error message here. Invalid CFML construct found... ColdFusion was looking at the following text: ( So then I tried moving the first closing bracked to include the arguments, but no go there either. This can be emulated if you have an object with a getter function

RE: Evaluate vs ?

2006-04-18 Thread Dan G. Switzer, II
Matt, What about this one: cfloop collection=struct_Params item=theKey cfset Evaluate(myObject.set#theKey#(struct_Params.#theKey#) / /cfloop Basically it is calling a setter method based on what is in the a structure. The cfset would evaluate to myObject.setFirstName('Matt') This is

Re: Evaluate vs ?

2006-04-18 Thread massimo
cfset getter = FirstName cfset myFN = myObject['get' getter]() / ---Throws error Other try: cfset myFN = myObject['get' getter '()'] / ---Also errors It's just a shoot in the dark, but, in my experience, if you want to dinamically define the method's name cfinvoke gives you more

Re: Evaluate vs ?

2006-04-18 Thread Matt Williams
Dan, This was close, but acts strange. I can do the following: cfoutput #myObject.getFirstName()# --- outputs correctly. cfset getter = FirstName / cfset doMethod = myObject[get getter] / cfset myFN = doMethod() / --- throws error #myFN# /cfoutput The error thrown by the doMethod() line is

Re: Evaluate vs ?

2006-04-18 Thread Raymond Camden
For cfinvoke to use an object instance,just do component=#inst# instead of component=somename On 4/18/06, Matt Williams [EMAIL PROTECTED] wrote: Dan, This was close, but acts strange. I can do the following: cfoutput #myObject.getFirstName()# --- outputs correctly. cfset getter =

Re: Evaluate vs ?

2006-04-18 Thread Matt Williams
So from Massimo and Ray's suggestions, it can it work. cfset getter = FirstName / cfinvoke component=#myObject# method=get#getter# returnvariable=theFN / cfoutput#theFN#/cfoutput No errors and output as expected. But it seems the other should be possible too? Have I stumped the CF-Talkers?

Re: Evaluate vs ?

2006-04-18 Thread Stan Winchester
Is there a time when evaluate should be used? It's generally more expensive to tell the computer to treat a literal string as an expression, than to just give the computer an expression in the first place. ~| Message:

RE: Evaluate vs ?

2006-04-18 Thread Loathe
No. -- Timothy Heald Analyst, Architect, Developer [EMAIL PROTECTED] W: 202-228-8372 C: 703-300-3911 -Original Message- From: Stan Winchester [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 18, 2006 1:12 PM To: CF-Talk Subject: Re: Evaluate vs ? Is there a time when evaluate should

Re: Evaluate vs ?

2006-04-18 Thread Claude Schneegans
Is there a time when evaluate should be used? There WAS a time, when structures were not available in CF, but nowadays, you can always avoid it. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send

Re: Evaluate vs ?

2006-04-18 Thread Nick de Voil
Is there a time when evaluate should be used? If you want to dynamically build an unpredictable string which contains logic, rather than just variable names, then afaik you can only invoke the logic using Evaluate(). But then again, that's not something that people need to do very often. Nick

RE: Evaluate vs ?

2006-04-18 Thread Dan G. Switzer, II
Matt, So from Massimo and Ray's suggestions, it can it work. cfset getter = FirstName / cfinvoke component=#myObject# method=get#getter# returnvariable=theFN / cfoutput#theFN#/cfoutput No errors and output as expected. But it seems the other should be possible too? Have I stumped the

Re: Evaluate vs ?

2006-04-18 Thread Charles Sheehan-Miles
Sometimes I send out emails through my system which dynamically generate the content from variables: example: Last year you gave $#lsnumberformat(lastyear, 9.99)# to support our work. This year we hope you'll give $#lsnumberformat(lastyear*2, 9.99)#. My mailer routine uses evaluate against the

Re: Evaluate vs ?

2006-04-18 Thread Nick de Voil
Last year you gave $#lsnumberformat(lastyear, 9.99)# to support our work. This year we hope you'll give $#lsnumberformat(lastyear*2, 9.99)#. My mailer routine uses evaluate against the string to parse out those values, then it is sent out via cfmail inside a loop. If Evaluate() isn't

Re: Evaluate vs ?

2006-04-18 Thread Russ Michaels
:01 -0400 Subject: Re: Evaluate vs ? Sometimes I send out emails through my system which dynamically generate the content from variables: example: Last year you gave $#lsnumberformat(lastyear, 9.99)# to support our work. This year we hope you'll give $#lsnumberformat(lastyear*2, 9.99

Re: Evaluate vs ?

2006-04-18 Thread Russ Michaels
- From: Claude Schneegans [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Date: Tue, 18 Apr 2006 13:22:35 -0400 Subject: Re: Evaluate vs ? Is there a time when evaluate should be used? There WAS a time, when structures were not available in CF, but nowadays, you can always avoid

RE: Evaluate vs ?

2006-04-18 Thread Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions
] Sent: Tuesday, April 18, 2006 12:04 PM To: CF-Talk Subject: Re: Evaluate vs ? that's not really true claude, take the following. cfset foo = fee fi fo fum #variable# this is dynamic content You would need to use DE() and Evaluate() to output the content of foo properly with any variables

Re: Evaluate vs ?

2006-04-18 Thread Aaron Rouse
[mailto:[EMAIL PROTECTED] Sent: Tuesday, April 18, 2006 12:04 PM To: CF-Talk Subject: Re: Evaluate vs ? that's not really true claude, take the following. cfset foo = fee fi fo fum #variable# this is dynamic content You would need to use DE() and Evaluate() to output the content of foo

RE: Evaluate vs ?

2006-04-18 Thread Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions
-Miles [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Date: Tue, 18 Apr 2006 13:42:01 -0400 Subject: Re: Evaluate vs ? Sometimes I send out emails through my system which dynamically generate the content from variables: example: Last year you gave $#lsnumberformat(lastyear, 9.99

RE: Evaluate vs ?

2006-04-18 Thread Dave Watts
Is there a time when evaluate should be used? Nick's answer is pretty much on target. It used to be the case that you needed to do this, because in some cases you had no way to reference variable names when you didn't know them until runtime. As CF's scopes became exposed as structures, the need

Evaluate vs ?

2006-04-17 Thread Stan Winchester
I've read you should not use Evaluate(). In the following example, what would be best practice? cfloop index=i from=1 to=#FORM.itemsOnPage# set Quantity = val(Evaluate(FORM.Quantity_ i)) / /cfloop Thank you, Aftershock Web Design, Inc. by: Stan Winchester President/Developer

Re: Evaluate vs ?

2006-04-17 Thread Ryan Guill
cfset Quantity = form.[Quantity_#i#] / On 4/17/06, Stan Winchester [EMAIL PROTECTED] wrote: I've read you should not use Evaluate(). In the following example, what would be best practice? cfloop index=i from=1 to=#FORM.itemsOnPage# set Quantity = val(Evaluate(FORM.Quantity_ i)) /

Re: Evaluate vs ?

2006-04-17 Thread Ryan Guill
Err, sorry, no period in there... On 4/17/06, Ryan Guill [EMAIL PROTECTED] wrote: cfset Quantity = form.[Quantity_#i#] / On 4/17/06, Stan Winchester [EMAIL PROTECTED] wrote: I've read you should not use Evaluate(). In the following example, what would be best practice? cfloop

Re: Evaluate vs ?

2006-04-17 Thread Rob Wilkerson
You could use #form['quantity_' i]# On 4/17/06, Stan Winchester [EMAIL PROTECTED] wrote: I've read you should not use Evaluate(). In the following example, what would be best practice? cfloop index=i from=1 to=#FORM.itemsOnPage# set Quantity = val(Evaluate(FORM.Quantity_ i)) /

Re: Evaluate vs ?

2006-04-17 Thread Jochem van Dieten
Stan Winchester wrote: I've read you should not use Evaluate(). In the following example, what would be best practice? cfloop index=i from=1 to=#FORM.itemsOnPage# set Quantity = val(Evaluate(FORM.Quantity_ i)) / /cfloop cfloop index=i from=1 to=#Val(form.itemsOnPage)# set Quantity =

Re: Evaluate vs ?

2006-04-17 Thread Stan Winchester
Thanks everybody! I thought it was something like that. cfloop index=i from=1 to=#FORM.itemsOnPage# set Quantity = val(Evaluate(FORM.Quantity_ i)) / /cfloop ~| Message:

Re: Evaluate vs ?

2006-04-17 Thread Mike Kear
What's the matter with using evaluate? Cheers Mike Kear Windsor, NSW, Australia Certified Advanced ColdFusion Developer AFP Webworks http://afpwebworks.com ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month On 4/18/06, Stan Winchester [EMAIL PROTECTED] wrote: Thanks everybody! I thought

Re: Evaluate vs ?

2006-04-17 Thread Charlie Griefer
generally speaking, it's considered to be slow and somewhat inefficient (this is not just in CF, btw... in most languages that I'm aware of) On 4/17/06, Mike Kear [EMAIL PROTECTED] wrote: What's the matter with using evaluate? Cheers Mike Kear Windsor, NSW, Australia Certified Advanced

Re: Evaluate vs ?

2006-04-17 Thread Claude Schneegans
What's the matter with using evaluate? VERY VERY BAD indeed. It will cost at least 1/2 mili sec per page, it will completely clog the server, waist all its banwidth, and worst: it will slow down the whole Internet in the planet! ;-)) -- ___ REUSE CODE! Use

RE: Evaluate vs ?

2006-04-17 Thread Loathe
: Re: Evaluate vs ? Err, sorry, no period in there... On 4/17/06, Ryan Guill [EMAIL PROTECTED] wrote: cfset Quantity = form.[Quantity_#i#] / On 4/17/06, Stan Winchester [EMAIL PROTECTED] wrote: I've read you should not use Evaluate(). In the following example, what would be best

RE: Evaluate vs ?

2006-04-17 Thread Phillip B. Holmes
[mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 6:49 PM To: CF-Talk Subject: Re: Evaluate vs ? What's the matter with using evaluate? Cheers Mike Kear Windsor, NSW, Australia Certified Advanced ColdFusion Developer AFP Webworks http://afpwebworks.com ColdFusion, PHP, ASP, ASP.NET hosting

Re: Evaluate vs ?

2006-04-17 Thread Mike Kear
Claude, you forgot to mention bringing about the downfall of civilisation as we know it, and cause all our kids to learn to play the banjo. Cheers Mike Kear Windsor, NSW, Australia Certified Advanced ColdFusion Developer AFP Webworks http://afpwebworks.com ColdFusion, PHP, ASP, ASP.NET hosting

RE: Evaluate vs ?

2006-04-17 Thread Dave Watts
What's the matter with using evaluate? It's generally more expensive to tell the computer to treat a literal string as an expression, than to just give the computer an expression in the first place. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the