Railo has exactly this setting. You can either let Railo scan all scopes 
like CFML, or for example the variables scope only. In addition in Railo 
you can turn off implicit query scanning as well. So you would recieve 
an error when you execute the following:

<cfquery name="getAddresses" ...>
    SELECT name, firstname from addresses
</cfquery>

<cfoutput query="getAddresses">
    name: #firstname# #name#
</cfquery>

My two notes on this. Not only is scoping variables easier to use, it is 
much more performant. Just imagine you would use a variable from the 
client scope without scoping it. CF would need to scan through 8 other 
scopes first in order to find it first.

So to round up the example before just use:

<cfoutput query="getAddresses">
    name: #getAddresses.firstname# #getAddresses.name#
</cfquery>

Greetings / GrĂ¼sse
Gert Franz
Customer Care
Railo Technologies GmbH
[EMAIL PROTECTED]
www.railo.ch

Join our Mailing List / Treten Sie unserer Mailingliste bei:
deutsch: http://de.groups.yahoo.com/group/railo/
english: http://groups.yahoo.com/group/railo_talk/



Gaulin, Mark schrieb:
> Yeah, I wish there was an admin setting that would REQUIRE all variables
> to be scoped (like VB's "Option Explicit").  Of course, I sometimes get
> lazy and don't include the "variables." scope prefix, so I'd get stung
> by this once in a while too, but hey, that would be a good thing.
>
>       Mark
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Monday, May 21, 2007 1:09 PM
> To: CF-Talk
> Subject: Shocked!
>
> I just looked at some code from another developer and noticed that they
> were accessing variables in the arguments scope witout using the
> ARGUMENTS. prefix to the variable name.  I was about to wander over to
> him and ask him why his application wasn't working when I decided I'd
> better test it first.
>
> I was shocked to see my test function work.  I just can't believe that
> Adobe would even expose those variables without a scope prefix.  I know
> that it does a top-down search through the myriad of scopes, but this
> just seems flat out dangerous.
>
> Was anyone else aware of this?
>
> - Steve
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278802
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to