But where does that reference get placed?  You have to put that unnamed
scope somewhere, and since CFINCLUDE only knows about the variables scope
(and the various other "higher level" scopes), that's where it ends up.  The
disconnect happens because CFINCLDUEs and CFCs are so fundementally
different that even something as 'basic' as the VARIABLES scope is totally
different between the two.

I suppose that placing it in the request scope would be a potential
workaround, since CF is single-threaded per request, so it would be
impossible for stuff to stomp on other things toes.  I think a better
solution would probably have been for CFINCLUDE and CFMODULE inside a CFC to
be a compile-time error.

Cheers,
barneyb

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Jim Davis
> Sent: Friday, May 07, 2004 2:39 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] CFINCLUDE forces var scope into arguments?
> 
> True - but if that externally compiled and executed template can see
> something in the wrapper file, then it could see something else in the
> wrapper file.
> 
> In the case however the unnamed variables can't be placed in 
> the unnamed
> scope of a CFINCLUDE (since one doesn't exist), but a 
> reference to named
> object could be passed to a CFINCLUDE.
> 
> Jim Davis
> 
> 
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf
> > Of Barney Boisvert
> > Sent: Friday, May 07, 2004 4:56 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [CFCDev] CFINCLUDE forces var scope into arguments?
> > 
> > Keep in mind that the external template is compiled and executed
> > separately
> > from the actual function.  It's not a textual include of 
> the file content
> > before compilation or execution, it's a totally separate 
> object being
> > called
> > that is outside the function object that actually knows 
> about it's local
> > variables.  In other words, whether the scope is named or 
> not, you still
> > have to copy the values to the variables scope for the 
> external template
> > to
> > access them.
> > 
> > Cheers,
> > barneyb
> > 
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On Behalf Of Jim Davis
> > > Sent: Friday, May 07, 2004 1:47 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: [CFCDev] CFINCLUDE forces var scope into arguments?
> > >
> > > Well... I think the simple solution would have been to create
> > > a local NAMED
> > > scope instead of local unnamed scope.
> > >
> > > Then the CFINCLUDE could be given access that the named
> > > entity just as it's
> > > given access to the named variables scope.
> > >
> > > 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]
> 
> 
> 
> ----------------------------------------------------------
> 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]
> 

----------------------------------------------------------
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