I've just read through the CFC Theory thread from last fall, and I don't understand why noone ever suggested this:
Why not just create the private scope? i.e. <cfcomponent> <cfset private.anyvar = 'hidden value'> </cfcomponent> Or use pr.anyvar for less typing. Or self.anyvar, or anything other than the public 'this'. What am I missing? Why is there a big problem with 'this' being public, when it is so easy to create private variables, and you don't have to use the unnamed scope or the variables scope (with the bug) to do it? Date: 09/02/2002 01:32 PM Author: Jeffry Houser At 09:27 AM 9/1/2002 -0700, you wrote: > > 3. Is the data created inside a component protected from outside > > forces? I'm a little grey on this one. You can create component specific > > variables using the this scope. > >"this" scope is public, the unnamed scope is private so this gets a YES. :hmm: That is interesting. I don't like un-named scopes. I wish someone at Macromedia took a little time to document this stuff. I thought the variable was automatically put into the this scope. I have to agree with Hal on this one. That is a kludge. The scope should have a name. A scope named private would have been a better option. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4