Not sure where it is in the docs - maybe in the same area that describes
structures in general?

Basically, if the name of the key is hard coded, and does not contain a
space, you can use dot noation.

<cfoutput>#person.age#</cfoutput>

If the key is dynamic, you must use bracket notation.

<cfset key = "age">
<cfoutput>#person[key]#</cfoutput>

Or, if the key contains a space, use bracket notation:

<cfoutput>#person["last name"]#</cfoutput>

PS

Did you know if you do this in CF:

<cfset x.y = 1>

WITHOUT first doing:

<cfset x = structNew()>

that you have actually created a variable named "x.y" instead of a
structure? 

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Valerie L. Criswell [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, April 09, 2002 12:27 PM
> To: CF-Talk
> Subject: Re: is this even possible?? Loop using lists?
> 
> 
> What is this bracket notation and where can I find more info? 
>  It looks
> mighty handy.
> 
> ~Val
> 
> ----- Original Message -----
> From: "Raymond Camden" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, April 09, 2002 12:00 PM
> Subject: RE: is this even possible?? Loop using lists?
> 
> 
> > Ack! Evaluate police!
> >
> > You do not need to use evaluate to get dynamic form names. Just use
> > bracket notation.
> >
> > <cfset thisName = form["name#i#"]>
> > etc.
> >
> 
> 
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to