I haven't looked too closely to your original question, figured it is
probably already fixed. But I saw this and thought for the benefit of
all...
<cfloop collection="#SESSION.PCalc#" item="key">
<cfset SESSION.MyCalcArray[arrayLen(SESSION.MyCalcArray)].["#key#"] =
#SESSION.PCalc[key]# />
</cfloop>
This notation (SESSION.MyCalcArray[arrayLen(SESSION.MyCalcArray)].["#key#"])
Should be this (SESSION.MyCalcArray[arrayLen(SESSION.MyCalcArray)][key])
*without the dot*
William
-----Original Message-----
From: Eric Nicholas Sweeney [mailto:[email protected]]
Sent: Tuesday, June 21, 2011 3:04 PM
To: cf-newbie
Subject: RE: Trouble with a Struct in an Array
In trying to approach this from a different angle - I am also trying to
insert my struct by looping over the keys with an Array Len - - but I can't
get the syntax right for the ["#key#"] - I need to do some sort of
Evaulate() - but I can't get that to work either...
How do I write that?
<cfset temp = arrayAppend(SESSION.MyCalcArray, structNew())>
<cfloop collection="#SESSION.PCalc#" item="key">
<cfset SESSION.MyCalcArray[arrayLen(SESSION.MyCalcArray)].["#key#"] =
#SESSION.PCalc[key]# />
</cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5337
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm