Minor confusion on variable scopes

2009-11-02 Thread Stefan Richter
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

Re: Minor confusion on variable scopes

2009-11-02 Thread Jason Fisher
Yes, in the methods of Application.cfc, you need to specify the scope, including the Application scope. For Application attributes (sessiontimeout, name, etc), you can specify those in the THIS scope, but only outside the methods: cfcomponent cfset this.name = myApp / cfset

Re: Minor confusion on variable scopes

2009-11-02 Thread Stefan Richter
Thanks for clearing that up Jason. On 2 Nov 2009, at 11:50, Jason Fisher wrote: Yes, in the methods of Application.cfc, you need to specify the scope, including the Application scope. For Application attributes (sessiontimeout, name, etc), you can specify those in the THIS scope, but

Re: Minor confusion on variable scopes

2009-11-02 Thread Dominic Watson
I had this question in a job interview once, 'which Application.cfc method shares the variables scope with the rest of the application?'. I, of course, said, 'none of them do, the variables scope is local to the application' and they said that the correct answer was 'onRequest' - total hogwash.