On 11/10/05, Phillip Senn <[EMAIL PROTECTED]> wrote:
> Well, I'm particularly struggling with the scoping inside of cfcs.
> There was some discussion last week about using var instead of variables.
> And there was some discussion of not exposing variables outside the cfc.
> So I need to put together some 'typical' examples.
> Are there any built already?

var vs. variables isn't an either/or thing.  If you var scope
something inside a cffunction, it will be local to that function, and
you HAVE to var scope ALL your variables that are local to your
cffunctions in order to make them thread safe.  The variables scope,
on the other hand, makes things available throughout the CFC (i.e. not
local to a particular function, but available anywhere within the
CFC).  The variables scope also protects your variables because they
can't be set from outside the CFC like "this" scoped variables can.

Matt
--
Matt Woodward
[EMAIL PROTECTED]
http://www.mattwoodward.com


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to