Menu

#24 creating a structure inside of a CFFunction

open
nobody
None
5
2008-04-27
2008-04-27
Anonymous
No

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#">

Discussion


Log in to post a comment.