Yes, they are accessible just like any variable in the variables scope.
Simple test: make a CFC with two methods:

<cfcomponent>

        <cffunction name="init">
                <cfset variables.i = 1 />
        </cffunction>

        <cffunction name="methodOne">
                <cfset var i = 3 />
                <cfinclude template="_test.cfm" />
        </cffunction>
        
        <cffunction name="methodTwo">
                <cfoutput>#variables.i#</cfoutput>
        </cffunction>

</cfcomponent>

Make the _test.cfm include (empty file).

And finally, make a driver:

<cfset test = createObject("component", "test") />

<cfset test.init() />
<cfset test.methodOne() />
<cfset test.methodTwo() />

Output is "3 3", indicating that those variables created for the include are
standard VARIABLES scope variables.  If you remove the CFINCLUDE from
methodOne(), you'll get "3 1", because 'i' stayed local, and didn't
overwrite the value from the init method that was actually set in the
variables scope.

Not the news you wanted, but better now than later.

Cheers,
barneyb
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Jim Davis
> Sent: Friday, May 07, 2004 11:31 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] CFINCLUDE forces var scope into arguments?
> 
> True... has this aspect been verified, tho?
> 
> In other words do the variables set actually overwrite 
> variables in other
> requests on the same instance?  Are the local-now-variable 
> values available
> after the include finishes processing?
> 
> I guess this is something I'll have to experiment with and 
> possibly change
> my whole design...
> 
> Jim Davis

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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