Skip to main content
This topic has been closed for replies.

2 replies

Charlie Arehart
Community Expert
Community Expert
October 20, 2012

This section should be updated to reflect the new support for colon ( notation for defining structure keys as key:value pairs.

So for the example above showing:

that could now be done in CF10 as:

<cfset coInfo=>

(BTW, the example which I've quoted is actually missing a closing bracket in the text above.)

/Charlie (troubleshooter, carehart. org)
Charlie Arehart
Community Expert
Community Expert
October 20, 2012

Ugg: it seems that the editor used for comments here does not permit use of tags. That's really lamentable.

I will repeat here the two lines of code I was offering, without any brackets this time:

Old way:

cfset coInfo={name="Adobe Systems Incorporated", industry="software"}

New way:

cfset coInfo=

(BTW, it's curious that while the first line disappeared entirely when my first comment is displayed, the second line appears partially. So it's not really that ALL tag using brackets disappears, but all of some lines, and some of other lines. Either way, it would be helpful if this web page editor, used for entering comments on a tag-based language like CFML, was able to handle displaying any code entered here.)

/Charlie (troubleshooter, carehart. org)
Charlie Arehart
Community Expert
Community Expert
October 20, 2012

Wow, even colons seem to cause problems, so that the "new way" line still is botched. Put it this way, reader: you can replace the = within the curly braces with a colon (:). It seems that the editor doesn't like when a colon is used with curly braces. Go figure!

/Charlie (troubleshooter, carehart. org)
Participating Frequently
June 21, 2012

These are valid statements.

<cfset myStruct = {structKey1 = {innerStructKey1 = "innerStructValue1"}}>

<cfset myStruct={structKey1.innerStructKey1 = "innerStructValue1"}>

A closing angle bracket (>) is missing in

<cfset innerStruct1 = {innerStructKey1 = "innerStructValue1"}

An extra quotation in front of "Adobe Systems Incorporated" in

<cfset "#i#"={name = ""Adobe Systems Incorporated"}>

This is also a valid statement.

<cfset "#i#"={name = "Adobe Systems Incorporated"}>