Actually, passing in a query passes in a reference. If you change the query in the custom tag, it changes it in the caller as well. Something to watch out for. If you do decide to pass in the query and do change it and don't _want_ to change the original, you would need to use duplicate when passing the query.
======================================================================= Raymond Camden, ColdFusion Jedi Master for Macromedia Email : [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -----Original Message----- > From: Sam Farmer [mailto:[EMAIL PROTECTED]] > Sent: Friday, August 02, 2002 9:47 AM > To: CF-Talk > Subject: Re: Calling Queries > > > Thanks, think I tried just about every other combination.... > > We had a long discussion here over whether it would be better > to pass the > query in as opposed to just the name. Our concearn with > passing in the > query was that we would be duplicating the query in memory--just in > different places. With a small query this would be no real > concearn, but > with a big query we thought it might be a problem. > Especially as we are > already passing the query from a cfc into a cfm page. Does > this make sense > or are we worrying about the memory too much/incorrectly?? > > Thanks, > > Sam > > ----- Original Message ----- > From: "Raymond Camden" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Friday, August 02, 2002 9:35 AM > Subject: RE: Calling Queries > > > > Sure, instead of > > > > <cfset theQuery = evaluate("caller.#attributes.query#")> > > > > you would do > > > > <cfset theQuery = caller[attributes.query]> > > > > Query - why are you passing the name of the query instead > of the query > > itself?? > > > > > ============================================================== > ========= > > Raymond Camden, ColdFusion Jedi Master for Macromedia > > > > Email : [EMAIL PROTECTED] > > Yahoo IM : morpheus > > > > "My ally is the Force, and a powerful ally it is." - Yoda > > > > > -----Original Message----- > > > From: Sam Farmer [mailto:[EMAIL PROTECTED]] > > > Sent: Friday, August 02, 2002 9:31 AM > > > To: CF-Talk > > > Subject: Re: Calling Queries > > > > > > > > > Thanks Raymond. > > > > > > I am on MX is there a magic cure on that? > > > > > > Thanks, > > > > > > Sam > > > > > > > > > ----- Original Message ----- > > > From: "Raymond Camden" <[EMAIL PROTECTED]> > > > To: "CF-Talk" <[EMAIL PROTECTED]> > > > Sent: Thursday, August 01, 2002 5:53 PM > > > Subject: RE: Calling Queries > > > > > > > > > > In this case, I believe you do need to use evaluate (unless > > > you are on > > > > MX!). However, your code will use N evaluates, where N is > > > the rowcount. > > > > You can get around this by doing one: > > > > > > > > <cfset theQuery = evaluate("caller.#attributes.query#")> > > > > > > > > Then your code gets MUCH easier: > > > > > > > > <cfoutput query="theQuery"> > > > > <option value="#theQuery[attributes.value][currentRow]#" etc > > > > > > > > > > > ============================================================== > > > ========= > > > > Raymond Camden, ColdFusion Jedi Master for Macromedia > > > > > > > > Email : [EMAIL PROTECTED] > > > > Yahoo IM : morpheus > > > > > > > > "My ally is the Force, and a powerful ally it is." - Yoda > > > > > > > > > -----Original Message----- > > > > > From: Sam Farmer [mailto:[EMAIL PROTECTED]] > > > > > Sent: Thursday, August 01, 2002 5:48 PM > > > > > To: CF-Talk > > > > > Subject: Calling Queries > > > > > > > > > > > > > > > Hi, > > > > > > > > > > I am trying to rewrite an old custom tag of ours that takes > > > > > in a query and > > > > > outputs it with right options selected. Nothing too > > > > > tricky...except that I > > > > > can not work out how to get around using evaluate. > > > > > > > > > > Anyone got any pointers? > > > > > > > > > > This is the code: > > > > > > > > > > <cfoutput query="caller.#attributes.query#"> > > > > > <option value="#evaluate("#attributes.value#")#" <cfif > > > > > listfind(attributes.selected,evaluate("#attributes.value#"))>S > > > > > ELECTED</cfif> > > > > > >#evaluate("#attributes.display#")# > > > > > </cfoutput> > > > > > > > > > > Thanks, > > > > > > > > > > Sam > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

