David,

Everything in CF (starting with CFMX and partially before that) is an
"object" that has a "parent".


For example, if I do the following:

<cfset x = 10/>

I have created a "member" of the "variables" scope ("variables" is the
object and "x" is the member). 

So I could do the following with x:

<cfoutput>#x#</cfoutput>

<cfoutput>#variables.x#</cfoutput>

<cfoutput>#variables[x]#</cfoutput>


This is true of every scope in CF - application, variables, form, url,
arguments, attributes, request, server, session..... Each of these are
objects with members.

Why does <cfoutput>#x#</cfoutput> work you ask? Because when CF sees a var
that has no parent object specified it looks in the variables scope
(followed by url and then form) and figures it out for you. This is done for
convenience but the abstraction keeps you from understanding what is going
on under the hood. 

-Mark




Mark A. Kruger, CFG, MCSE
(402) 408-3733 ext 105
www.cfwebtools.com
www.coldfusionmuse.com
www.necfug.com

-----Original Message-----
From: David Moore, Jr. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2008 9:44 AM
To: CF-Talk
Subject: RE: How NOT to Evaluate (moved from cfset so not to confuse topic)

Adrian Wrote:
 
> SELECT *> FROM Contacts> WHERE Contacts.ContactType = 'Physician'> AND 
> Contacts.#FORM.Field# = '#FORM[FORM.Field]#'> ORDER BY 
> Contacts.LastName
 
What is the [] for. How would they be used. I have never used them at all.
What is the protocal. Is that CF or SQL or... > And then throw in some
cfqueryparams.
I am just starting to write in the cfqueryparams. That is a new one too.
 
~David
_________________________________________________________________
Want to do more with Windows Live? Learn "10 hidden secrets" from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!55
0F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312315
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to