What does your cfinclude do? is it possible (i.e. quick and easy) to switch it to a cfmodule? cfmodules have better encapsulation of their data and are so similar to cfincludes that presumably it wouldn't be much work to switch the code. Right?
Just an idea. -nolan -----Original Message----- From: Roland Collins [mailto:[EMAIL PROTECTED] Sent: Thursday, May 06, 2004 3:05 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] CFINCLUDE forces var scope into arguments? Not a fan of this glitch. It renders var pretty useless in any function using a cfinclude then. :( -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Barney Boisvert Sent: Thursday, May 06, 2004 6:01 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] CFINCLUDE forces var scope into arguments? That's so that you can use CFINCLUDE inside functions and you'll be able to access variables. This is a little tiny "glitch" that was allowed through so you can reap greater benefits (being able to use CFINCLUDE in functions at all). Basic templates don't know about the local scope, because its only for functions/methods. In other words, in order for the template you're CFINCLUDEing into your function to be able to access the local variables (including arguments), they have to be moved to a scope the template can access them in. Cheers, barneyb > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Roland Collins > Sent: Thursday, May 06, 2004 2:54 PM > To: [EMAIL PROTECTED] > Subject: [CFCDev] CFINCLUDE forces var scope into arguments? > > I just noticed an odd behavior that I wanted to confirm. > > I have a CFC that has a function that uses a CFINCLUDE in the > function to > set some variables. At the top of that function, I have a > bunch of "var" > scoped variables. If I dump the "variables" scope immediately after > declaring these, all is well - they don't show up. After I call the > CFINCLUDE however, if I dump the "variables" scope, all of my > "var" scope > variables have been dumped into the "variables" scope!!!!! > > I though I was crazy at first, but I've tried it numerous > times now, and > it's always true! Attached is a simple test case. Run > test.cfm and you'll > see what I mean. > > !?!?!?! > > Roland > ---------------------------------------------------------- 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]
