Thanks for the clarification--that makes great sense, and is no doubt the best way to 
treat these modules (coincidentally, I've been reading up on SOAP and web services 
lately, and I'm really looking forward to hearing more on the new CF delivery features 
at CF-North).  Now, if I can only convince the folks here to take this next 
'modularizing' step . . . :).  Thanks again for the insight.

REM O-

>>> [EMAIL PROTECTED] 04/18/02 06:11PM >>>
Rey, the way I do it you don't need the evaluate function. This is
because when I call the appliation recursively, I don't want it to
display stuff, but simply to return information (you can see that it's a
short step from this to web services). So the "consuming" page, as it
were, always knows that it expects a local variable. It's the job of the
code providing the information to determine whether this means a value
for Scope of "" or "caller."

-----Original Message-----
From: Rey Muradaz [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 18, 2002 6:33 PM
To: [EMAIL PROTECTED] 
Subject: RE: Moduling circuits


When I first read this, I thought I'd had a 'Eureka!' moment.  We've
been debating the methods for handling passed vars when a module is
called as a tag, and had settled on scoping all 'double-duty' vars in a
potential module to 'attributes' scope, so they'd be ready to handle
vars coming in through 'direct' routes (form/url) or a cfmodule tag.  

The obvious downside to this is figuring out how to pass vars back out
again (and how to know when you need to modify the scope).  This
approach appears to solve for that, but then I tried to explain it to
someone here, and was left with this:

--CALLING PAGE--
<cfset test="hi">
<cfmodule name="showTest.cfm">

--showTest.cfm--
<cfoutput>#Evaluate(Scope & "test")#</cfoutput>

Is there a better way of handling the use of #scope# in the called
fuseaction?  It seems pretty ugly to have to use the Evaluate() function
like this to append the scope, but it's also quite possible I'm missing
something.  Any guidance/insight would be greatly appreciated.

TIA,
REM O-

>>> [EMAIL PROTECTED] 04/18/02 01:21PM >>>
This is really quite simple and works slicker 'n well...you know. Let's
say you want to execute the fuseaction, Cart.addItem. But before that
you want to check if the item is in stock. It so happens you already
have a fuseaction, Inventory.checkStock, that returns a recordset with
the quantity on hand, but that's in the Inventory circuit. Here's how to
handle it:

In the Cart circuit's FBX_Switch file:

<cfcase value="addItem">
  <cfmodule template="#Fusebox.rootPath##self#"
fuseaction="Inventory.checkStock">
  <cfinclude template="qry_AddItemToCart.cfm">
</cfcase>

The only issue is what scope the Inventory.checkStock returns its record
set in, since it might be called in the normal fashion OR it might be
called as part of a custom tag call. Here's how I do it:

I put this code in the FBX_Settings.cfm file of the home circuit:

<cfset Scope="">
<cfif Fusebox.isCustomTag>
  <cfset Scope="caller.">
</cfif>

Then, any time I want a variable to do double-duty, I just prefix it
with #Scope#variable_Name. Make sense?

-----Original Message-----
From: Drew Parker [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 18, 2002 2:43 PM
To: [EMAIL PROTECTED] 
Subject: Moduling circuits


Hi Ppls,
   Can spmeone direct me to where I can read up on the 'How to do's' of 
using Cfmodule to call certain circuits?
I have a circuit that performs a certain function and rather than 
copying the whole circuit into every directory where I need to use this 
functionality, I thought a cfmodule call to the circuit would save me 
heaps of space.  Just how this is done and getting the circuit to 
function properly when called as a module, I have no idea.

Cheers in advance 
Drew

Any word back from the US Postal service Hal?  regarding the Conference 
in a box?

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================

Reply via email to