Is this a Bug in the sense that my code will not run correctly.  Or is it a
Bug in the sense that this is not a standard and/or correct behavior for an
object?

If I am understanding you correctly, using the "This" scope, the variables
are available inside and outside of the component, in other words they are
"public" properties/variables.  But a variable without a scope specification
is in this "Unknown/unnamed" scope and are only accessible to methods within
the component, in other words they are "private".  If I code with this
understanding, does this cause a problem?

I did an experiment.  I added the following code to my CFC.

 <cfset A = 5>
 <cfset B = 3>
 
 <cfset Variables.A = 7>
 <cfset Variables.B = 11>

When I access these variables later in a method, they where set to 7 and 11.
So what is this "unknown/unnamed" scope?  How does it cause a problem or
affect my coding?

--------------
Ian Skinner
Web Programmer
BloodSource
Sacramento, CA

-----Original Message-----
From: Michael Tangorre [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 10:32 AM
To: CF-Talk
Subject: Re: CFC Newbie Discussion.


Let me point out the scope bug...

using "this" scope exposes your data members outside of the cfc. In
addition, the variables scope is not the default for not providing a scope
within a CFC. There is something known as the "unknown" scope. This unknown
scope allows data members to be available to functions within the CFC... not
outside of.

this.someVar would be accessible inside and outside of the CFC
someVar would be accessible inside the CFC to the functions only. 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to