I'm trying to set a few variables in my Application.cfc file and I'm a  
bit confused about scopes.

Here's what I have got:

   <cffunction name="onApplicationStart">

         <cfset APPLICATION.page_title = "My Title">
        <cfreturn True>

</cffunction>


I can access this anywhere in my site as #APPLICATION.page_title#. But  
if I leave off the APPLICATION and write
  <cfset page_title = "My Title"> and then try to access a variable  
#page_title# CF9 throws an error, saying the variable is not defined  
(I restarted CF before testing this).
Variable PAGE_TITLE is undefined.



Why does this happen? Do I really need to prefix all variables with  
APPLICATION? According to the debugger a variable defined in  
Application.cfc without the APPLICATION prefix does not exist in any  
scope.

Stefan




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327897
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