> query
> arguments
> variables (local)
> CGI
> URL
> form
> cookie
> client
its a little screwy inside of a <cfoutput query=""> loop 

If you are pushing to the output stream query takes top spot but if
you are inside of a cfset variables (maybe arguments) takes top spot.
Its a little wacky so its always good to just scope your variables.

As for performance its worth mentioning that isdefined("url.bob") will
still search other scopes so using structKeyExists is a better option.
This has been discussed before but figured I'd throw in that reminder
since its on my mind today (form validation fun!).

Adam H 

On 7/5/05, Charlie Griefer <[EMAIL PROTECTED]> wrote:
> if you don't scope a variable, you force CF to have to 'hunt' through
> the various scopes to find a variable with the given name.  this is
> generally considered to be a bad practice, as it's less efficient than
> explicitly scoping the variable (thus telling CF exactly where to
> look), and you could end up with a same-named variable in a
> higher-priority scope getting referenced instead of the scope you're
> looking for.
> 
> if memory serves, the order of precendence is:
> 
> query
> arguments
> variables (local)
> CGI
> URL
> form
> cookie
> client
> 
> so if you have form.email, and myQuery.email, and just do
> <cfoutput>#email#</cfoutput> with the intention of getting form.email,
> you're actually going to end up with myQuery.email.
> 
> 
> On 7/5/05, Robert Redpath <[EMAIL PROTECTED]> wrote:
> > What is the proper way to refer to form objects?
> >
> > #form.email# or #email#
> >
> > Are they interchangeable?  Can I call use <cfparam name="form.email" 
> > default="">, but still refer to it as #email#?
> >
> > Many thanks,
> >
> > Bob
> >
> >
> >
> >
> >
> >
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211191
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to