Arrayset Issues from CF9 to CF11
Hello,
On CF9, I am having no issues. Currently, I am testing on a new web server with CF11 update 10. The error I am receiving is:
0 is not greater than zero or less than or equal to 0.The range passed to ArraySet must begin with a number greater than zero and less than or equal to the second number.
Here is a snippet of my code (not sure if you will need more than that). The bolded code is where it is saying it is erroring out on and I believe is where I need to make a change. I am more or less looking for more ideas on what to check or if something has changed since CF9 that I have not read on. I tried referencing Re: Crosstab - array error for my issue but still couldn't find a good solution. I was told to create a new thread.
---
<cfset bucketlist = ValueList(crosstabcolumns2.ts_desc)>
<cfset bucketheaders = ListToArray(bucketlist)>
<cfset b = ArrayLen(bucketheaders)>
<cfset bucketarray = ArrayNew(1)>
<cfset bucketTotal = ArrayNew(1)>
<cfset temp = arrayset(bucketTotal,1,b,"0")>
<cfoutput query="summedresultsNewOld" group="classcode">
<table border="1" cellpadding="5">
<tr><th width="225">MAIN CAMPUS</th>
<cfloop index="i" From="1" to="#b#">
<th>#bucketheaders#</th>
</cfloop>
<th width="125">TOTALS</th>
</tr>
<cfoutput group="ts_type" >
<tr><th>#ts_type#</th>
<cfset temp = arrayset(bucketarray,1,b,"0")>
<cfoutput>
<cfset i = listfind(bucketlist, trim(summedresultsNewOld.ts_desc))>
<cfset temp = ArraySet(bucketarray, i, i, summedresultsNewOld.headcount)>
<cfset temp = ArraySet(BucketTotal,i, i, (BucketTotal + summedresultsNewOld.headcount))>
</cfoutput>
<cfset rowtotal = 0>
<cfloop index="j" from="1" to="#b#">
<cfset rowtotal = #rowtotal# + #bucketarray
<td width="125">#bucketarray
</cfloop>
<td>#rowtotal#</td>
</tr>
</cfoutput>
<tr>
<th bgcolor="##999999">TOTALS</th>
<cfloop index="j" from="1" to="#b#">
<td bgcolor="##999999">#BucketTotal
</cfloop>
<td bgcolor="##999999">#ArraySum(BucketTotal)#</td>
</tr>
</table>
</cfoutput>
---
This is the result of what it should look like (currently in CF9). Any help is appreciated!

