latest reactions

spider
One way is to google for page which cont …
andy
you can find this tool here http://andy. …
Tjarko
Eej Walker, that's pretty cool, I will c …
Walker
Thanks for posting your thoughts. I modi …
Albert
Thanks !! …

Clicky Web Analytics
Use OpenDNS
ZERIGO DNS

Ultimate dns hosting based on pre-defined templates, DNS redirection and lot's more.

mxna feeds

CF101 Archive: September 2007 Object Oriented PizzaJob Opening for ColdFusion Developer at Arizona State UniversityMy New Experience Getting ColdFusion Builder 2 Console WorkingCF101 Archive: February 2007 Data Table GatewaysJob Opening for Sr. ColdFusion Developer in CA/ San Fernando ValleyColdFusion Supports HTTP Verbs PUT And DELETE (As Well As GET And POST)Best wishes for the new FuseboxCF101 Archive: January 2007 Data Access ObjectsOpen Source Conference For CFML DevelopersSkype Blocking Web Services with IIS, ColdFusion & RailoCF101 Archive: October 2006 Five Cool Things with ColdFusionGenerate a tag cloud from an RSS feed with ColdFusionColdFusion MeetUp: Cloudy with a Chance of Tests, with Mike HenkeReminder - Adobe CookbooksCF101 Archive: September 2006 A first look at FusionDebug

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2012 mximize.com.
All right reserved.

Visit Carlos GallupaMXNA webfeed

Coldfusion scopes and the order of precedence

If you do not specify the scope of the variable, according to the docs, CF will search for it in the following order (this is called the order of precedence):

  • Local variables
  • cfquery
  • CGI
  • File
  • URL
  • Form
  • Cookie
  • Client

Other scopes always need to be scoped:

  • Server
  • Application
  • Session
  • Request
  • Attributes
  • Error

8504 viewed | 6 opinion(s)  | del.icio.us | Digg it | Tjarko @ 20/06/07 15:33 cet


Reactions:

barrry.b wrote.... (mail)

I'm not sure if this is the case in CF8 but in earlier versions, that precedence checking happens within a CFC as well. it doesn't just stop with the variables and this scope, it continues on to form, url, cookie, etc...

20 June 2007 16:07 cet  

Tjarko wrote.... (site)

I'm not sure what you mean by that?? The form, url and cookie scope are in the list... It's just the order that ColdFusion looks at your variable if you don't scope it.

20 June 2007 16:09 cet  

Cutter wrote.... (site)

I think what barrry.b was trying to say is that CFCs work in a slightly different fashion than a standard cfm template, as far as order of precedence is concerned. You have function-local variables (those initialized with the 'var', and do not have a scope prefix) that are always first, even over the VARIABLES scope. There is also the THIS scope within CFCs, though I am not sure of their scope precedence location off the top of my head (I never use 'em).

20 June 2007 19:42 cet  

Tjarko wrote.... (site)

This THIS scope that everybody is referring to.. is this used by anyone... this?? ;-) Sorry.. could resist!

20 June 2007 20:26 cet  

jax wrote....

Yes, I use it on some vars in my CFC's. When I explicitly want to access the var directly from outside the CFC.I useit for instance with a global logging mechanism I implemented based on Log4J.

This is cool.

:-)

20 June 2007 21:46 cet  

Allen wrote....

cfquery is not a scope

29 May 2009 20:56 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!