Thanks, I was talking about when setting a variable, just didn't explain
myself very well.

Great and simple to understand explanation. 


--
Timothy Heald
Analyst, Architect, Developer
[EMAIL PROTECTED]
W: 202-228-8372
C: 703-300-3911
-----Original Message-----
From: Paul Hastings [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 30, 2006 9:45 PM
To: CF-Talk
Subject: Re: The var scope in CFCs was(RE: CFWDDX and Component Objects)

Loathe wrote:
> Ok, so here's something I never got.  If variables.foo is private, 
> what is

the unnamed/variables scope isn't "private" *within* the CFC. it's
accessible to all methods. it's invisible to the caller though. the var
scope is invisible to all other methods, ie it's private to the method it's
used in.

> var variables.foo?

why on earth would you do that? first off you'd have to declare some
variable,

var variables.foo=1;

would throw an invalid variable reference. and declaring a var scope
variable would simply make it equal to the variables scope variable.

variables.foo=1;
var fubar=variables.foo;
return fubar;

would return 1.

> What does var do?  When/why would you use it?

it makes a variable private to that method. why use it? so you don't shoot
yourself in the nether regions when other methods are called that might use
the same variable name or when that method is called in simultaneously
(under a load).



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236651
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to