> -----Original Message-----
> From: Sean Corfield [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 24, 2004 3:20 AM
> To: CF-Talk
> Subject: Re: Prefixing local variables
> 
> On Fri, 24 Dec 2004 02:31:02 -0500, Jim Davis
> <[EMAIL PROTECTED]> wrote:
> > Personally, within functions I always declare the following "phony
> scope":
> >
> > <cfset var local = StructNew() />
> >
> > Then all of my local variables are prefixed with "local" as in:
> >
> > <cfset local.SomeThing = "" />
> 
> That's a reasonable compromise, in my opinion, since "local" doesn't
> have any fancy characters identifying it as a 'local' variable and
> then, thereafter, you are explicitly qualifying the 'scope' of all
> your variables. There's nothing artificial about your suggestion - I
> like it!

Yes - I'm rather pleased with it as well.  ;^)

One more benefit, this way I can dump or pass the "local" scope as I would
any other scope.

The major drawback is (of course) the same as all the other options
mentioned so far: you've got to remember to actually do this every time
(those loop counters will catch you every time!).

Jim Davis




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188742
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