> Is this something new or has it always been available. Why doesn't the CF
> manuals or help mention it? Is there any danger in using object notation.

It's always been like that. The [] notation is best for dynamic struct
access, ie:

<CFSET KEY = "Boo">
<CFSET VAL = Struct[Key]>

This would output Struct.Boo. If you did Struct.Key, it would treat "Key" as
the literal name for the key.

So, if you need to output a key and don't know the name at runtime, you
would use [] notation. You _could_ do an Evaluate on the dot format, but
that stinks for two reasons, one, it's slow, secondly, if the dynamic key
was "Ray Camden", then you would get an error trying to evaluate Struct.Ray
Camden, which isn't a valid variable. Struct["Ray Camden"] is though.

> Is either one the preferred notation for any reason? Better performance?
> More accepted style? etc. etc.

Use what makes sense. I use dot notation for simple stuff, ie, struct.name,
etc. In general, if I know the key name at design time, I use dot notation.
If I don't, I use [].

=======================================================================
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


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to