Even so, always scope your variables! It hardly adds any time to
development and it makes your code much more readable and easier to
follow later on.

On Thu, Dec 29, 2011 at 8:40 AM, Justin Scott <[email protected]> wrote:
>
>> When I use REQUEST.dataSource it tells me the name set in the
>> Application.cfc boy I feel dumb!
>
> That's okay, we all start somewhere.  Most of the time you can
> reference a variable name without its scope and ColdFusion will find
> it for you.  See the scope priority list to see how ColdFusion
> searches through the scopes to find variable references:
>
> http://fusiongrokker.com/post/scope-priority-changes-in-coldfusion-9
>
> The request, application, and session scopes are not searched,
> however, and need to be referenced directly as you discovered.  It's
> always considered good practice to explicitly scope all variable
> references to make your code more readable and prevent unexpected
> errors and collisions.
>
>
> -Justin Scott
>
> 

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

Reply via email to