That won't get around it, because when you CFINCLUDE, the 'local' struct will dump to 'variables', which means one copy of 'local' for the CFC _instance_. As soon as you get two concurrent method calls, you'll have issues. If you pick a unique name within the CFC (for instance, the name of the function), then it'll work.
Cheers, barneyb > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jim Davis > Sent: Friday, May 07, 2004 8:57 AM > To: [EMAIL PROTECTED] > Subject: RE: [CFCDev] CFINCLUDE forces var scope into arguments? > > For exactly this reason (well... and a coupla others) I > create a pseudo > scope for all function local variables. > > I add the following line to the top of every function (after > the args): > > <cfset var local = StructNew()> > > Then use only key in "local" for all function-local > variables. It doesn't > prevent the glitch, but as long as you never use "local" as a > var name other > than that it does greatly minimize the impact of it. > > Jim Davis > > > -----Original Message----- > > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > > Of Roland Collins > > Sent: Thursday, May 06, 2004 6: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] > ---------------------------------------------------------- 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]