Not sure if you were asking the difference between this and variables or if you were saying you know.
But just in case this scope are public variables variables scope are private variables Regards Dale Fraser http://learncf.com -----Original Message----- From: Michael Nguyen [mailto:[EMAIL PROTECTED] Sent: Wednesday, 17 October 2007 10:55 PM To: CF-Talk Subject: RE: Problem with using variables scope I would upgrade CF to 7 or 8 it but it's client's decision, unfortunately:( I have fixed that by changing variables scope to "this" scope. It works but you know about the disadvantages of using this.instance rather than variables.instance. It's just a fix to get it works but I'm not quite happy and can't explain why variables.instance is visible from outside. Michael -----Original Message----- From: Dale Fraser [mailto:[EMAIL PROTECTED] Sent: Tuesday, 16 October 2007 1:43 PM To: CF-Talk Subject: RE: Problem with using variables scope Never seen that with 7 and now 8 and do that type of thing all the time. If this is just 6, id say upgrade. Your right, it shouldn't happen. Regards Dale Fraser http://learncf.com -----Original Message----- From: Michael Nguyen [mailto:[EMAIL PROTECTED] Sent: Tuesday, 16 October 2007 2:25 PM To: CF-Talk Subject: Problem with using variables scope Hi People, I have encountered a very weird error with variables scope. <cfset var AnnouncementBean = createObject("component","mypath.announcement").init(argumentcollection=argu ments)/> and <cfset var AnnouncementType = createObject("component","mypath.announcementType").init(argumentcollection= arguments)/> Then I dump those two objects and found that the AnnouncementBean object is the same as AnnouncementType (it has properties and methods of AnnouncementType ) When I comment the creation of the second object then dump it, it show the correct object. I found that because <cfset variables.instance = StructNew() /> is declared in both objects and when I created the second object, this variables.instance overrides the first variables.instance was created in the first one. To me, it's really really weird as the variables scope exists only within that object. Using CFMX 7 is ok, the CF6 causes this problem. I am running in Unix. Any help is appreciated. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291314 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

