Re: How is this done without evaluate()?

2009-03-20 Thread Claude Schneegans
value=#Caller.getItem[attributes.type 'EasyFrame']# Yes,... except that getItem is a query in the calling template, So maybe value=#Caller.getItem[attributes.type 'EasyFrame'][Caller.getItem.currentRow]# Not sure if it is more efficient, but certainly not as easy to read.

Re: How is this done without evaluate()?

2009-03-20 Thread Scott Stroz
I have only ever used evaluate() in my CF code once. Every other time I thought I needed it, I was able to use array notation to solve the problem. On the flip side I once inherited an app that used evaluate() 839 times. On one page, there were 93 instances of evaluate(). On Thu, Mar 19, 2009

Re: How is this done without evaluate()?

2009-03-20 Thread Claude Schneegans
Personally I think that the anti-evaluate slant is a bit of orthodoxy that was picked up on years ago (when it was much more computationally expensive) and enforced as such by members of the CF community. Right, and it is not proper to the CF community, I remember having the same discussion

Re: How is this done without evaluate()?

2009-03-20 Thread Yuliang Ruan
well personally i try to avoid evaluates too. it still is about the computational expense.same with query of queries. the expense of QoQ can be seen dramatically when there's looping involved. I remember when I first started at this job, one of the components was doing a recursive

Re: Re: How is this done without evaluate()?

2009-03-20 Thread dsbrady
The one time I know we have to use it is because we have some database tables where some fields actually have CF expressions in them, so to have those expressions get, errr, evaluated, we have to use evaluate(). On Mar 19, 2009 8:10pm, Dave Watts dwa...@figleaf.com wrote: In general,

RE: Re: How is this done without evaluate()?

2009-03-20 Thread Adrian Lynch
Another way is to write them to a file and cfinclude it. But in this case I think Evaluate might look nicer... Adrian -Original Message- From: dsbr...@gmail.com [mailto:dsbr...@gmail.com] Sent: 20 March 2009 15:37 To: cf-talk Subject: Re: Re: How is this done without evaluate

How is this done without evaluate()?

2009-03-19 Thread Jim McAtee
I read that in CF8 evaluate() should no longer be necessary. If so, how would you cleanly rewrite the code below without it? I have a table populated with form field corresponding with records in a table, each idendified by record id. Say I have the record ids in a list. cfset

Re: How is this done without evaluate()?

2009-03-19 Thread Dave Watts
On Thu, Mar 19, 2009 at 17:18, Jim McAtee jmca...@mediaodyssey.com wrote: I read that in CF8 evaluate() should no longer be necessary.  If so, how would you cleanly rewrite the code below without it? I have a table populated with form field corresponding with records in a table, each

Re: How is this done without evaluate()?

2009-03-19 Thread Jake Churchill
Try this (not tested): input type=text name=#id#_name value=#form[id'_name']# I've done this in earlier versions of CF as well Jake Churchill CF Webtools 11204 Davenport, Ste. 100 Omaha, NE 68154 http://www.cfwebtools.com 402-408-3733 x103 Jim McAtee wrote: I read that in CF8 evaluate()

Re: How is this done without evaluate()?

2009-03-19 Thread Barney Boisvert
#evaluate('form.#id#_name')# becomes #form[#id#_name]# cheers, barneyb On Thu, Mar 19, 2009 at 2:18 PM, Jim McAtee jmca...@mediaodyssey.com wrote: I read that in CF8 evaluate() should no longer be necessary.  If so, how would you cleanly rewrite the code below without it? I have a table

Re: How is this done without evaluate()?

2009-03-19 Thread Claude Schneegans
I read that in CF8 evaluate() should no longer be necessary. This is wrong. What is true is Should not be used if not necessary Which by the way is your case here. But there are more complex issues where it can't be avoided. Dave gave you the answer.

Re: How is this done without evaluate()?

2009-03-19 Thread Jim McAtee
PM Subject: Re: How is this done without evaluate()? I read that in CF8 evaluate() should no longer be necessary. This is wrong. What is true is Should not be used if not necessary Which by the way is your case here. But there are more complex issues where it can't be avoided

Re: How is this done without evaluate()?

2009-03-19 Thread Claude Schneegans
Why Should not be used if not necessary? Because, if it is not necessary, hen there is an alternative using [] and it is more effiecient, although the difference may be a couple of miliseconds. What would be an example where it's necessary? For instance, I have this in a custom tag:

Re: How is this done without evaluate()?

2009-03-19 Thread Dave Watts
For instance, I have this in a custom tag: VALUE=#evaluate('caller.getItem.' attributes.type 'EasyFrame')# There might be a better way, but I got tired trying to figure it out. value=#Caller.getItem[attributes.type 'EasyFrame']# Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/

Re: How is this done without evaluate()?

2009-03-19 Thread Dave Watts
I must have been thinking about setVariable().  Why Should not be used if not necessary?  What would be an example where it's necessary? In general, evaluating strings as expressions is computationally expensive. I can't think of any cases where I've had to use it in quite a while, but I

Re: How is this done without evaluate()?

2009-03-19 Thread Gerald Guido
In general, evaluating strings as expressions is computationally expensive. I can't think of any cases where I've had to use it in quite a while, but I suspect there are some rare cases where you can't get what you need any other way. Personally I think that the anti-evaluate slant is a bit of

Re: How is this done without evaluate()?

2009-03-19 Thread Gerald Guido
Opps. I posted an old version of the cfc. The new(er) one is in cfscript damn... my bad... but the offer still holds to not use evaluate. G! Note to self must sleep. Sleep good. On Thu, Mar 19, 2009 at 10:56 PM, Gerald Guido gerald.gu...@gmail.comwrote: In general, evaluating

Re: How is this done without evaluate()?

2009-03-19 Thread Dan Baughman
and its sloppy, newbie code On Thu, Mar 19, 2009 at 9:40 PM, Dan Baughman dan.baugh...@gmail.comwrote: Dudes... stfu evaluate can be avoided. (notice the period). . thanks dan On Thu, Mar 19, 2009 at 9:28 PM, Gerald Guido gerald.gu...@gmail.comwrote: Opps. I posted an old version

Re: How is this done without evaluate()?

2009-03-19 Thread Dan Baughman
Dudes... stfu evaluate can be avoided. (notice the period). . thanks dan On Thu, Mar 19, 2009 at 9:28 PM, Gerald Guido gerald.gu...@gmail.comwrote: Opps. I posted an old version of the cfc. The new(er) one is in cfscript damn... my bad... but the offer still holds to not use

Re: How is this done without evaluate()?

2009-03-19 Thread Ezra Parker
Some times it cannot be avoided with out a boat load of thinking and trial and error. Case in point, and I will gladly change this bit of code to not use evaluate if someone can figure out how to do this in CFscript sans the evaluate function: OK, I'll bite. It's certainly much more verbose, and