BlastRadius
Programmer
I have created an array and filled it's values with structures. Now how do I get the info back out. I'll include the code.
<cfset arraySpread = arraynew(1)>
<cfloop index="i" from="1" to="#rsBudgetTrans.recordCount#">
<!---Create a structure to hold each row of the speadsheat--->
<cfset structTemp = structNew()>
<cfloop query="rsBudgetTrans">
<cfloop query="rsChqBudget">
<cfif rsBudgetTrans.BudgetID eq rsChqBudget.BudgetID>
<cfset strValue = rsBudgetTrans.BudgetTransactionAmount>
<cfelse>
<cfset strValue = 0>
</cfif>
<cfset strBudget = rsChqBudget.BudgetID>
<cfset structTemp.strBudget = strValue>
</cfloop>
<cfloop query="rsSaveBudget">
<cfif rsBudgetTrans.BudgetID eq rsSaveBudget.BudgetID>
<cfset strValue = rsBudgetTrans.BudgetTransactionAmount>
<cfelse>
<cfset strValue = 0>
</cfif>
<cfset strBudget = rsSaveBudget.BudgetID>
<cfset structTemp.strBudget = strValue>
</cfloop>
<cfset structTemp.Date = rsBudgetTrans.TransactionDate>
<cfset structTemp.Description = rsBudgetTrans.TransactionDescription>
<cfset structTemp.Amount = rsBudgetTrans.TransactionAmount>
</cfloop>
<cfset arraySpread = structTemp>
</cfloop>
now to get it back out I have tries alot of diferent things but I will include my last attemp.
<cfoutput>#arraySpread[1].structTemp["Date"]#</cfoutput>
Does cold fusion let you store stuctures in arrays?
<cfset arraySpread = arraynew(1)>
<cfloop index="i" from="1" to="#rsBudgetTrans.recordCount#">
<!---Create a structure to hold each row of the speadsheat--->
<cfset structTemp = structNew()>
<cfloop query="rsBudgetTrans">
<cfloop query="rsChqBudget">
<cfif rsBudgetTrans.BudgetID eq rsChqBudget.BudgetID>
<cfset strValue = rsBudgetTrans.BudgetTransactionAmount>
<cfelse>
<cfset strValue = 0>
</cfif>
<cfset strBudget = rsChqBudget.BudgetID>
<cfset structTemp.strBudget = strValue>
</cfloop>
<cfloop query="rsSaveBudget">
<cfif rsBudgetTrans.BudgetID eq rsSaveBudget.BudgetID>
<cfset strValue = rsBudgetTrans.BudgetTransactionAmount>
<cfelse>
<cfset strValue = 0>
</cfif>
<cfset strBudget = rsSaveBudget.BudgetID>
<cfset structTemp.strBudget = strValue>
</cfloop>
<cfset structTemp.Date = rsBudgetTrans.TransactionDate>
<cfset structTemp.Description = rsBudgetTrans.TransactionDescription>
<cfset structTemp.Amount = rsBudgetTrans.TransactionAmount>
</cfloop>
<cfset arraySpread = structTemp>
</cfloop>
now to get it back out I have tries alot of diferent things but I will include my last attemp.
<cfoutput>#arraySpread[1].structTemp["Date"]#</cfoutput>
Does cold fusion let you store stuctures in arrays?