So in my getCart() method how would I return the query?

<CFRETURN getCart> OR <CFRETURN VARIABLES.getCart>

Is there a difference?

And in my other method called setOrderWeight() could I just use CFLOOP to
loop over the query like this?

<CFLOOP QUERY="getCart">
...
</CFLOOP>


Dave Cordes
Macromedia Certified Professional
636-265-0094 (Office)
636-578-4235 (Mobile)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Raymond Camden
Sent: Thursday, October 09, 2003 9:30 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Query Reuse in Multiple CFCs


No, you can simply store the result of getCart in a variables scoped
variable. You just to make sure that if a method modifies the cart, that
you rerun getCart. Your code would look something like this pseudo-code:

getCart {

        if(not isDefined("variables.cartQuery")) run the query and save
it as variables.cartQuery;
        return variables.cartQuery;

}

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Dave Cordes
> Sent: Thursday, October 09, 2003 7:44 AM
> To: [EMAIL PROTECTED]
> Subject: [CFCDev] Query Reuse in Multiple CFCs
>
>
> I'm running into a problem reusing the same query in multiple
> CFCs. I don't know how to do it!
>
> If I run say a getCart() method which returns a query that I
> need to reuse in several other methods like
> setOrderSubtotal() and setOrderTaxes() would I have to call
> the getCart() method several times within each method or can
> I reuse the first one that I ran?
>
> Is there a better way? I'm guessing there is.
>
> Thanks,
>
>
> Dave Cordes
> Macromedia Certified Professional
> 636-265-0094 (Office)
> 636-578-4235 (Mobile)
>
>


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to