Answered
Structure variable undefined
Hi All,
I have a problem in using structure and am not sure what I am missing here. I get the following error:
Variable STRSUMMARY is undefined : line 8. This is where NOT StructKeyExists(strSummary,theKey)) code starts.
The code is as below:
<script>
strSummary = StructNew();
</script>
<cfloop query="speclist">
<cfscript>
theKey = "#option#_#model#_#mfr#_#qty#";
if (NOT StructKeyExists(strSummary,theKey)){
strSummary[theKey] = StructNew();
strSummary[theKey].option = option;
strSummary[theKey].model = model;
strSummary[theKey].mfr = mfr;
strSummary[theKey].qty = qty;
strSummary[theKey].itemid = itemid;
}
ArrayAppend(strSummary[theKey].itemid,itemid);
</cfscript>
</cfloop>
Thanks
I have a problem in using structure and am not sure what I am missing here. I get the following error:
Variable STRSUMMARY is undefined : line 8. This is where NOT StructKeyExists(strSummary,theKey)) code starts.
The code is as below:
<script>
strSummary = StructNew();
</script>
<cfloop query="speclist">
<cfscript>
theKey = "#option#_#model#_#mfr#_#qty#";
if (NOT StructKeyExists(strSummary,theKey)){
strSummary[theKey] = StructNew();
strSummary[theKey].option = option;
strSummary[theKey].model = model;
strSummary[theKey].mfr = mfr;
strSummary[theKey].qty = qty;
strSummary[theKey].itemid = itemid;
}
ArrayAppend(strSummary[theKey].itemid,itemid);
</cfscript>
</cfloop>
Thanks