Well variable["one"] is different to variable["#one#"]

You still need quotes if you are referring to the name of a key directly, 
rather than using a variable to indirectly reference it.

<cfset variable.one = 1 />
<cfset variable.two = 2 />
<cfset variable.elephant = 3 />
<cfset one = "elephant" />

variable["one"] is 1
variable[one] is variable["elephant"] is 3
variable["#one#"] is variable["elephant"] is 3
variable["two"] is 2
variable[two] causes error (variable two is undefined)
variable["#two#"] causes same error

So variable[x] and variable["#x#"] are the same, but the first is easier to 
read and quicker to type.

However, sometimes you might have, say variable.fish1 variable.fish2 
variable.fish3 etc. Ideally that'd be an array, but if you cant use an array 
then you might end up doing variable["fish#x#"] instead. You can also use 
variable["fish"&x] as well.


Does that all make sense?



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

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315905
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