When structures where introduced in CF4.0, the manual did show both ways
of referencing. Both will work fine the same way.



-----Original Message-----
From: Tim Dempsey [mailto:[EMAIL PROTECTED]] 
Sent: Friday, 24 August 2001 12:39 AM
To: CF-Talk
Subject: Structure notation

Folks,

Perhaps the collective wisdom of the list can enlighten me about the
syntax
available to reference structure elements.

In Cold Fusion manuals and Studio help as well as in the Ben Forta books
the
way to reference elements of a structure is given as

structure_name["element_name"]

But I have seen examples of structure_name.element_name being allowed
and
now I see that the new O'Reilly ColdFusion book lists object notation
like
that as one of the ways to reference structure elements.

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.

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

I found one case where the bracket notation seemed to be required: the
name
of the element was itself a variable, specifically, the result of a
function. For example:

<cfset structure.substructure['#Evaluate("##xxxxx##")#'] = ......>

I couldn't say structure.substructure.#Evaluate("#xxxxx#")

How come?

Thanks for any insight you can give.


-- Tim Dempsey
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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