Right... And "doh!"
Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -----Original Message----- From: Adrian Lynch [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2008 10:27 AM To: CF-Talk Subject: RE: How NOT to Evaluate (moved from cfset so not to confuse topic) A little correction: <cfoutput>#variables[x]#</cfoutput> should be: <cfoutput>#variables["x"]#</cfoutput> Adrian -----Original Message----- From: Mark Kruger [mailto:[EMAIL PROTECTED] Sent: 10 September 2008 16:19 To: CF-Talk Subject: RE: How NOT to Evaluate (moved from cfset so not to confuse topic) 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:312321 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4