creating a structure inside of a CFFunction
Brought to you by:
smithos
I have some routines that call helper function that return structures. When I tried by app. on Smith the returned structures were missing nodes.
I have created a reproducible test case.
<cffunction name="makeStruct" returntype="struct">
<cfset var stTemp = StructNew()>
<cfset stTemp.First = "Texas">
<cfset stTemp.Second = "Ohio">
<cfset stTemp.Third = "New York">
<cfoutput>
#stTemp.First#<br>
#stTemp.Second#<br>
#stTemp.Third#<br>
</cfoutput>
<cfreturn stTemp>
</cffunction>
<cfset stLoc = StructNew()>
<cfset stLoc.node1 = "Dallas">
<cfset stLoc.node2 = "Columbus">
<cfset stLoc.node3 = "New York">
<cfset stLoc.Site = makeStruct()>
<cfdump var="#stLoc#">