Re: Evaluate vs ?

2006-04-20 Thread Russ Michaels
if you generate the content files and save them as static files, you can
just cfinclude them into your cfmail then you won't need to evaluate them.

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 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
 using evaluate.  Here's what happens:
 
 1) Customer saves their message content, which might look something
 like:
 
 Dear #firstname# #lastname#:
 
 Blah blah blah
 
 2) When they approve the message for sending, I queue the messages as:
 
 MessageID (referencing the previous message)
 MemberID (referencing the member tables which contain all the
 information)
 
 It then cfloops through each memberid, using evaluate to put in the
 correct
 member information, and generates personalized emails.
 
 I'm not the strongest programmer in the world, so this took some time
 to
 work out.  Biggest issue is I'm shortly taking on a much larger
 customer
 than I've dealt with before, so mailing sizes will increase from 20-30k
 per
 mailing to upwards of 200-300k messages.
 
 Problem is, I have no way of knowing what the message content will be
 before
 its sent, nor which variables the customer will choose to use in a
 particular mailing (they have about 45 fields to choose from). Hmm.
 
 
 On 4/19/06 4:20 AM, Russ Michaels [EMAIL PROTECTED] wrote:
 
  the variable must exist or you cannot evaluate it.
  In my example I specified saving the content to a file and
 cfincluding it,
  which is not what you have done below.
  
  This works fine for what you want below.
  
  cfset content = this is some dynamic content
  cfset foo = This is static content. #content#
  
  cfoutput
  #foo#
  /cfoutput
  Here is an example of evaluating an external file.
  
  cfset content = this is some dynamic content
  cfsavecontent variable=contentfile
  cfinclude template=content.cfm
  /cfsavecontent
  content from file:br
  br
  
  cfoutput
  #evaluate(de(contentfile))#
  /cfoutput
  
  --
  Russ (snake) 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# this is dynamic content
  If #variable# is not set CF errors, If #variable# is set puts value
  into
  foo.
  
  
  CFOUTPUT
  #foo#---foo would output to be   fee fi fo fum #variable#
 this
  is
  dynamic content  is what was wanted??
  /CFOUTPUT -not necessarily outputted, but to still contains
 the
  #variable# unresolved?
  
  
  This will set that up:
  cfset foo = fee fi fo fum ##variable## this is dynamic content
  
  But even using evaluate, this errors with (Invalid CFML construct
  found):
  
  cfset variable = fub
  
  cfoutput
  #evaluate(foo)#
  /cfoutput
  
  And just to test, this errors if #variable# is not set
  cfset foo = Evaluate(fee fi fo fum #variable# this is dynamic
  content)
  
  Can you show were this would work and be used, with evaluate?
  Have me curious now.
  
  
  
  
  -Original Message-
  From: Aaron Rouse [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, April 18, 2006 12:24 PM
  To: CF-Talk
  Subject: Re: Evaluate vs ?
  
  
  This does the same thing as his:
  
  cfset foo = fee fi fo fum #variable# this is dynamic content
  
  My guess is he was saying for the value of variable to not be put
  into foo
  until the time that it was outputed instead of when set.
  
  
  
  
  
  
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238248
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 = evaluate (mystruct.myvar  )
/CFLOOP
CFOUTPUTTime = #numberFormat(GetTickCount()-start, 999)#BR/CFOUTPUT

CFSET start = GetTickCount()
CFLOOP INDEX=i FROM=1 TO=10
CFSET test = mystruct['myvar'  ]
/CFLOOP
CFOUTPUTTime = #numberFormat(GetTickCount()-start, 999)#BR/CFOUTPUT

The results are (in avarage):
Time = 530 msec
Time = 200 msec

This show that
1. evaluate takes more than twice the double than struct notation;
2. the difference is about 1/3 sec for 10 iteration, then, unless 
you really use
evaluate in some million iterations loop, the difference is not really 
significant.

There are many other places to look for optimization, the first being 
queries and correct indexes in the database.


-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238267
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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.




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238309
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Evaluate vs ?

2006-04-20 Thread Charles Sheehan-Miles
Thanks will give it a try.  And yes, we do have a dedicated smtp server.

Charles

On 4/20/06 4:05 AM, Russ Michaels [EMAIL PROTECTED] wrote:

 if you generate the content files and save them as static files, you can
 just cfinclude them into your cfmail then you won't need to evaluate them.
 
 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 vs ?
 
 I'm going to have to do some serious thinking about this.  Performance


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238343
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Evaluate vs ?

2006-04-19 Thread Russ Michaels
the variable must exist or you cannot evaluate it.
In my example I specified saving the content to a file and cfincluding it,
which is not what you have done below.

This works fine for what you want below.

cfset content = this is some dynamic content
cfset foo = This is static content. #content#

cfoutput
#foo#
/cfoutput
Here is an example of evaluating an external file.

cfset content = this is some dynamic content
cfsavecontent variable=contentfile
cfinclude template=content.cfm
/cfsavecontent
content from file:br
br

cfoutput
#evaluate(de(contentfile))#
/cfoutput

--
Russ (snake) 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# this is dynamic content
 If #variable# is not set CF errors, If #variable# is set puts value
 into
 foo.
 
 
 CFOUTPUT
 #foo#---foo would output to be   fee fi fo fum #variable# this
 is
 dynamic content  is what was wanted??
 /CFOUTPUT -not necessarily outputted, but to still contains the
 #variable# unresolved?
 
 
 This will set that up:
 cfset foo = fee fi fo fum ##variable## this is dynamic content
 
 But even using evaluate, this errors with (Invalid CFML construct
 found):
 
 cfset variable = fub
 
 cfoutput
 #evaluate(foo)#
 /cfoutput
 
 And just to test, this errors if #variable# is not set
 cfset foo = Evaluate(fee fi fo fum #variable# this is dynamic
 content)
 
 Can you show were this would work and be used, with evaluate?
 Have me curious now.
 
 
 
 
 -Original Message-
 From: Aaron Rouse [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, April 18, 2006 12:24 PM
 To: CF-Talk
 Subject: Re: Evaluate vs ?
 
 
 This does the same thing as his:
 
 cfset foo = fee fi fo fum #variable# this is dynamic content
 
 My guess is he was saying for the value of variable to not be put
 into foo
 until the time that it was outputed instead of when set.
 
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238063
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Evaluate vs ?

2006-04-19 Thread Charles Sheehan-Miles
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
using evaluate.  Here's what happens:

1) Customer saves their message content, which might look something like:

Dear #firstname# #lastname#:

Blah blah blah

2) When they approve the message for sending, I queue the messages as:

MessageID (referencing the previous message)
MemberID (referencing the member tables which contain all the information)

It then cfloops through each memberid, using evaluate to put in the correct
member information, and generates personalized emails.

I'm not the strongest programmer in the world, so this took some time to
work out.  Biggest issue is I'm shortly taking on a much larger customer
than I've dealt with before, so mailing sizes will increase from 20-30k per
mailing to upwards of 200-300k messages.

Problem is, I have no way of knowing what the message content will be before
its sent, nor which variables the customer will choose to use in a
particular mailing (they have about 45 fields to choose from). Hmm.


On 4/19/06 4:20 AM, Russ Michaels [EMAIL PROTECTED] wrote:

 the variable must exist or you cannot evaluate it.
 In my example I specified saving the content to a file and cfincluding it,
 which is not what you have done below.
 
 This works fine for what you want below.
 
 cfset content = this is some dynamic content
 cfset foo = This is static content. #content#
 
 cfoutput
 #foo#
 /cfoutput
 Here is an example of evaluating an external file.
 
 cfset content = this is some dynamic content
 cfsavecontent variable=contentfile
 cfinclude template=content.cfm
 /cfsavecontent
 content from file:br
 br
 
 cfoutput
 #evaluate(de(contentfile))#
 /cfoutput
 
 --
 Russ (snake) 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# this is dynamic content
 If #variable# is not set CF errors, If #variable# is set puts value
 into
 foo.
 
 
 CFOUTPUT
 #foo#---foo would output to be   fee fi fo fum #variable# this
 is
 dynamic content  is what was wanted??
 /CFOUTPUT -not necessarily outputted, but to still contains the
 #variable# unresolved?
 
 
 This will set that up:
 cfset foo = fee fi fo fum ##variable## this is dynamic content
 
 But even using evaluate, this errors with (Invalid CFML construct
 found):
 
 cfset variable = fub
 
 cfoutput
 #evaluate(foo)#
 /cfoutput
 
 And just to test, this errors if #variable# is not set
 cfset foo = Evaluate(fee fi fo fum #variable# this is dynamic
 content)
 
 Can you show were this would work and be used, with evaluate?
 Have me curious now.
 
 
 
 
 -Original Message-
 From: Aaron Rouse [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 18, 2006 12:24 PM
 To: CF-Talk
 Subject: Re: Evaluate vs ?
 
 
 This does the same thing as his:
 
 cfset foo = fee fi fo fum #variable# this is dynamic content
 
 My guess is he was saying for the value of variable to not be put
 into foo
 until the time that it was outputed instead of when set.
 
 
 
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238243
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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
originates. With the example posted by Stan doesn't pose much risk, we
have probably all seen the following code:

cfloop list=#form.fieldnames# index=currentField
  set Quantity = Evaluate(currentField)
/cfloop

In this example, you are essentially running user generated code
inside your website. It is still limited to whatever Evaluate()
accepts, but you can get all sorts of interesting information if you
submit a form with a field named StructKeyList(session) or
StructClear(application).

Jochem




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237987
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 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 highest caliber vendor-authorized
 instruction at our training centers in Washington DC, Atlanta,
 Chicago, Baltimore, Northern Virginia, or on-site at your location.
 Visit http://training.figleaf.com/ for more information!


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237988
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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: http://www.houseoffusion.com/lists.cfm/link=i:4:237994
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237995
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 = #Evaluate(CMonth)#

 /cfloop


 Lee Surma

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237996
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 ?

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: http://www.houseoffusion.com/lists.cfm/link=i:4:237997
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 = #Evaluate(CMonth)#

 /cfloop


 Lee Surma

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237998
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Evaluate vs ?

2006-04-18 Thread Loathe
 cfscript
monthArray = arrayNew(1);
monthArray[1] = 0101;
monthArray[2] = 0102;
monthArray[3] = 0103;
/cfscript

Not sure what you're going for here, the above could be used in about the
same way or something like this:


cfloop from=1 to=3 index=I
010#i#
/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 ?

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: http://www.houseoffusion.com/lists.cfm/link=i:4:237999
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Evaluate vs ?

2006-04-18 Thread Ben Nadel
Lee,

While people here are suggesting the Variables scope, please realize that
you can create any object to do this:

Ex. cfset objMonths = StructNew() /

cfloop index=I from=1 to=3 step=1
 cfset objMonths[Month  i] =  /
/cfloop
 

cfdump var=#objMonths['Month'  2]#

...
Ben Nadel 
Web Developer
Nylon Technology
350 7th Ave.
Suite 1005
New York, NY 10001
212.691.1134 x 14
212.691.3477 fax
www.nylontechnology.com

Sanders: Lightspeed too slow?
Helmet: Yes we'll have to go right to ludacris speed.
-Original Message-
From: Rob Wilkerson [mailto:[EMAIL 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

 Cfloop from=1 to=3 index=i
 cfset CMonth = Month  i
 cfset CCMonth = #Evaluate(CMonth)#

 /cfloop


 Lee Surma

 



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238000
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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')


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238001
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 method based on what is in the a structure.
 The cfset would evaluate to myObject.setFirstName('Matt')


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238002
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238003
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 (assuming that if I can get this simple example to work, the
loop will work too).

cfset getter = FirstName
cfset myFN = myObject['get'  getter]() / ---Throws error

Other try:
cfset myFN = myObject['get'  getter  '()'] / ---Also errors


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238005
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 untested, but you should be able to do:

cfloop collection=struct_Params item=theKey
  !---// should create a reference to the method //---
  cfset doMethod = myObject[set  theKey] /
  !---// execute the method //---
  cfset doMethod(struct_Params[theKey]) /
/cfloop

-Dan


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238006
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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
flexibility, since you only have to pass a variable or CFML expression to
the method attribute.

The same it's true for whenever you want to dynamically generate the
arguments.

Don't get me wrong, I prefer dot notation myself (I find it easier to
read), but cfinvoke is handy on certain cases.

Massimo

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238008
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 coming from the Object CFC. It
says it that variables.FirstName is not defined, which is what the getter is
getting. It is as though it doesn't recognize it as the same object.

Massimo - I don't use cfinvoke much as I'm usually within a cfscript block.
However I'm not against trying it. How does cfinvoke refer to an object
instance. In my sample code I'm using myObject as that is a reference to an
already instantiated object (actually it is an object passed to the function
of another object).


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238012
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 = FirstName /
 cfset doMethod = myObject[get  getter] /
  cfset myFN = doMethod() / --- throws error
 #myFN#
 /cfoutput

 The error thrown by the doMethod() line is coming from the Object CFC. It
 says it that variables.FirstName is not defined, which is what the getter is
 getting. It is as though it doesn't recognize it as the same object.

 Massimo - I don't use cfinvoke much as I'm usually within a cfscript block.
 However I'm not against trying it. How does cfinvoke refer to an object
 instance. In my sample code I'm using myObject as that is a reference to an
 already instantiated object (actually it is an object passed to the function
 of another object).


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238014
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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?


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238016
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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: http://www.houseoffusion.com/lists.cfm/link=i:4:238020
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 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: http://www.houseoffusion.com/lists.cfm/link=i:4:238021
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238022
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238024
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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
CF-Talkers?

You could always wrap the cfinvoke / tag into a UDF so you could use it
from a cfscript block.

invoke(myObject, get#getter#);

You'd need to do a little work to pass in arguments, but it's definitely
do-able.

-Dan


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238025
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 string to parse out those
values, then it is sent out via cfmail inside a loop. If Evaluate() isn't
recommended, is there a better way to do this?  Typically this type of
mailing might go out to 10 or 12 thousand emails at once.


On 4/18/06 1:29 PM, Nick de Voil [EMAIL PROTECTED] wrote:

 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
 
 
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238026
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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
 recommended, is there a better way to do this?  Typically this type of
 mailing might go out to 10 or 12 thousand emails at once.

You mean you create a textual email template for each new mailing which
includes some raw CFML for the mail-merge fields? That seems a pretty good
case for using Evaluate() to me. Unless it's giving you bad performance
problems - if so, I guess you would be forced to restructure your system so
that your email template is no longer data, but a compiled CFML template.

Nick




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238029
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Evaluate vs ?

2006-04-18 Thread Russ Michaels
for this type of thing you can simply save the dynamic content as a file and 
cfinclude it between your cfmail tags. No need to evaluate anything then.

Russ

-Original Message-
From: Charles Sheehan-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)# 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
 recommended, is there a better way to do this?  Typically this type of
 mailing might go out to 10 or 12 thousand emails at once.
 
 
 On 4/18/06 1:29 PM, Nick de Voil [EMAIL PROTECTED] wrote:
 
  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
  
  
  
  
  
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238030
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Evaluate vs ?

2006-04-18 Thread Russ Michaels
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 displayed, there is no way to treat that as a 
struct.

Russ

-Original Message-
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 it.
 
 -- 
 ___
 REUSE CODE! Use custom tags;
 See http://www.contentbox.com/claude/customtags/tagstore.cfm
 (Please send any spam to this address: [EMAIL PROTECTED])
 Thanks.
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238031
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Evaluate vs ?

2006-04-18 Thread Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions
Unless I missed something,  there is no need to treat as a structure or use
DE() or Evaluate().

cfset foo = fee fi fo fum   #variable#  this is dynamic content


cfoutput
#foo#
/cfoutput


This would work just fine.






-Original Message-
From: Russ Michaels [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 
properly with any variables displayed, there is no way to treat that as a 
struct.

Russ


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238032
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Evaluate vs ?

2006-04-18 Thread Aaron Rouse
This does the same thing as his:

cfset foo = fee fi fo fum #variable# this is dynamic content

My guess is he was saying for the value of variable to not be put into foo
until the time that it was outputed instead of when set.



On 4/18/06, Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions 
[EMAIL PROTECTED] wrote:

 Unless I missed something,  there is no need to treat as a structure or
 use
 DE() or Evaluate().

 cfset foo = fee fi fo fum   #variable#  this is dynamic content


 cfoutput
 #foo#
 /cfoutput


 This would work just fine.






 -Original Message-
 From: Russ Michaels [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
 properly with any variables displayed, there is no way to treat that as a
 struct.

 Russ


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238033
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Evaluate vs ?

2006-04-18 Thread Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions
Here is part of the code I use to create emails that are sent out monthly.
I have removed a lot of code, queries and more of the msg being build, but
this should give you an idea.
By no means is this the best example .
But it does work:


CFOUTPUT query=Qgetteaminfo group=team
-Part of the msg being
build-
CFSET msg =For Team Members with Fewer than #holdmaxhours# logged
for period. #chr(13)##chr(10)# #chr(13)##chr(10)#
CFSET msg = msg  Team: #Qgetteaminfo.team#
CFOUTPUT
CFSET msg = msg  Team Member:
#Qgetteaminfo.memberName#
/CFOUTPUT

Adds to msg-
CFIF noaction EQ true
CFSET msg = msg  All Personnel on your team have
logged the required minimum hours for the reporting
period.#chr(13)##chr(10)#
/CFIF
/CFOUTPUT

CFMAIL here -BR

cfmail to=emial1 from=fromemail subject=Logged Hours for Month of:
#mon# 

The listed below individuals have logged the indicated hours
to I3MP for the Month of: #mon# #dyear#.
Please confirm accuracy and provide response NLT 10 days
from receipt.
Negative response indicates agreement with the hours
reported in this email. 
DO NOT REPLY TO THIS EMAIL.

#msg#

/cfmail






-Original Message-
From: Charles Sheehan-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)# 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 recommended, is there a better way to do this?  Typically this 
 type of mailing might go out to 10 or 12 thousand emails at once.
 
 
 On 4/18/06 1:29 PM, Nick de Voil [EMAIL PROTECTED] wrote:
 
  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
  
  
  
  
  
 
 



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238035
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 to do this has diminished
significantly.

That said, there presumably may be a time when you want to take an arbitrary
string and treat it as an expression, and Evaluate will be there for you.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238049
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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

http://www.aftershockweb.com/   

 




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237956
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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)) /

 /cfloop



 Thank you,

 Aftershock Web Design, Inc.

 by: Stan Winchester

 President/Developer

 http://www.aftershockweb.com/






 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237957
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 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
 
  http://www.aftershockweb.com/
 
 
 
 
 
 
  

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237958
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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)) /

 /cfloop



 Thank you,

 Aftershock Web Design, Inc.

 by: Stan Winchester

 President/Developer

 http://www.aftershockweb.com/






 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237959
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 = Val(form[Quantity_  i]) /
/cfloop

Jochem

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237960
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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: http://www.houseoffusion.com/lists.cfm/link=i:4:237961
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 it was something like that.

  cfloop index=i from=1 to=#FORM.itemsOnPage#
set Quantity = val(Evaluate(FORM.Quantity_  i)) /
  /cfloop




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237962
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 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 it was something like that.
 
   cfloop index=i from=1 to=#FORM.itemsOnPage#
 set Quantity = val(Evaluate(FORM.Quantity_  i)) /
   /cfloop
 
 


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237963
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237964
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Evaluate vs ?

2006-04-17 Thread Loathe
cfset quantity = form[quantity_  i]

Just a little style difference, I think at that point is more personal
opinion than actual measurable performance gains.

Tim

 -Original Message-
 From: Ryan Guill [mailto:[EMAIL PROTECTED]
 Sent: Monday, April 17, 2006 6:17 PM
 To: CF-Talk
 Subject: 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 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
  
   http://www.aftershockweb.com/
  
  
  
  
  
  
  

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237967
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Evaluate vs ?

2006-04-17 Thread Phillip B. Holmes
You really don't even need the val() function.
Using a foreach loop dramatically increases the speed of looping through
collections.

form action=myform.cfm method=post
input type=text name=quantity_1
input type=text name=quantity_2
input type=text name=quantity_3
input type=text name=quantity_4
input type=submit name=submit
/form

cfscript
if(isDefined('form.fieldnames')) {
// remove elements that you don't want
structDelete(form,'fieldnames');
structDelete(form,'submit');
structDelete(form,'searchstring');
for(it IN form) {
writeOutput(it  ':'  form[it]  'br /');
}
}
/cfscript



Warmest Regards,
 
Phillip B. Holmes
http://phillipholmes.com


=




-Original Message-
From: Mike Kear [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 from AUD$15/month



On 4/18/06, Stan Winchester [EMAIL PROTECTED] wrote:

 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: http://www.houseoffusion.com/lists.cfm/link=i:4:237969
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 from AUD$15/month



On 4/18/06, Claude Schneegans [EMAIL PROTECTED] wrote:

 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 custom tags;
 See http://www.contentbox.com/claude/customtags/tagstore.cfm
 (Please send any spam to this address: [EMAIL PROTECTED])
 Thanks.


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237971
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


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 highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237972
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54