See, depending on what the entire CFM page looked like and it's usage along
with what brought me into the code to debug things then I personally may not
see that output as obvious. Now I look at it that way because I have
inherited code from others who just plain had zero clue about scoping
variables.  I can even think of times where they had something exactly like
you described but they actually were expecting the values from
URL.myVariable

When you have <cfoutput>#Variables.myVariable#</cfoutput> then I can't see
why they'd ever question where is this coming from since the scope tells
them right there this is something set "locally" to the "page".  But then
again when you are dealing with someone else's code then you really have no
clue what their understanding of the language was or what their intent was.

A <cfset variables.myVariable = "fubar" /> and <cfset myVariable = "fubar"
/> are doing the exact same thing.  So to me they both ensure that a
myVariable will exist within the variables scope.  It's just the output of
things that I have found I often need to go hunting to figure out what their
intent was.

As I said before though, this is just in reference to straight CFM pages.

On Thu, May 19, 2011 at 2:55 AM, Dominic Watson <
watson.domi...@googlemail.com> wrote:

>
> Curiously, I do it the exact opposite way:
>
> <cfset variables.myVariable = "fubar" /> <!--- ensure that I am
> setting in the variables scope, because there could be a 'myVariable'
> in another scope --->
>
> <cfoutput>#myVariable#</cfoutput> <!--- I have just guaranteed that I
> have variables.myVariable, there is no possibility (afaik) that I
> could be refering to another 'myVariable'. --->
>
> However, I should probably scope both.
>
> Dominic
>
> On 18 May 2011 19:26, Aaron Rouse <aaron.ro...@gmail.com> wrote:
> >
> > This is my outlook although I do not do something like:
> >
> > <cfset Variables.strBlah = "something" />
> >
> > instead I do:
> >
> > <cfset strBlah = "something" />
> >
> > But I always would do:
> >
> > <cfoutput>#Variables.strBlah#</cfoutput>
> >
> > or
> >
> > <cfif Variables.strBlah IS "something">
> >
> > Seems to me that is what the original OP is asking about but perhaps I am
> > reading too much into it based upon what I do.  This is all in reference
> to
> > just straight CFM pages.
> >
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344656
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to