It looks like you are using the same index variable on the second array that
you used on the first array. That is why araary element 1-6 are not defined
as those values were already "incremented" through for the first array...ie:
<cfloop index="x" from="1" to="6">
<cfset array1[x]=1>
</cfloop>
<cfloop index="y" from="1" to="10">
<cfset array2[x]=1>
<cfset x=x+1>
</cfloop>
Array1 would have elements 1-6 defined and array2 would have elements 7-17
defined, with 1-6 being undefined.
Eric
/*-----Original Message-----
/*From: Steve Grosz [mailto:[EMAIL PROTECTED]
/*Sent: Saturday, October 18, 2008 10:55 AM
/*To: cf-talk
/*Subject: Array confusion
/*
/*Ok, I'm sorta new to working with arrays, but the code I'm using is:
/*
/*<!--- This will count all fencing ratings and assign them to an array ---
/*>
/* <cfset classList=arraynew(2)>
/* <cfset classListLoop="A,B,C,D,E,U">
/* <cfset bigLoopCount=0>
/* <cfif (#url.f# eq 1) and (#url.e# eq 1)>
/* <cfset bigLoopCount=2>
/* <cfelse>
/* <cfset bigLoopCount=1>
/* </cfif>
/* <cfset classLoopCount=1>
/* <cfloop from="1" to="#bigLoopCount#" index="j">
/* <cfloop list="#classListLoop#" delimiters=","
index="i">
/* <cfset classList[#j#][#classLoopCount#][1]=#i#>
/* <!--- send to udf to count each rating occurance and assign
/*to variable --->
/* <cfinvoke component="components.ov_rating"
/*method="rating" returnvariable="result">
/* <cfinvokeargument name="tid"
/*value="#url.tid#">
/* <cfinvokeargument name="dbfield"
/*value="e_foil_rating">
/* <cfinvokeargument name="rating" value="#i#">
/* </cfinvoke>
/* <cfset classList[#j#][#classLoopCount#][2]=#result#>
/* <cfset classLoopCount=classLoopCount+1>
/* </cfloop>
/* </cfloop>
/*
/*What I'm getting for the <cfdump> of the array classList, if
/*bigLoopCount=2, is:
/*
/*Array 1
/* Array 1 Struct 1 A
/* 2 0
/* Array 2 Struct 1 B
/* 2 0
/* Array 3 Struct 1 C
/* 2 0
/* Array 4 Struct 1 D
/* 2 1
/* Array 5 Struct 1 E
/* 2 2
/* Array 6 Struct 1 U
/* 2 0
/*Array 2
/* Array 1 [undefined array element]
/* Array 2 [undefined array element]
/* Array 3 [undefined array element]
/* Array 4 [undefined array element]
/* Array 5 [undefined array element]
/* Array 6 [undefined array element]
/* Array 7 Struct 1 A
/* 2 0
/* Array 8 Struct 1 B
/* 2 0
/* Array 9 Struct 1 C
/* 2 0
/* Array 10 Struct 1 D
/* 2 1
/* Array 11 Struct 1 E
/* 2 2
/* Array 12 Struct 1 U
/* 2 0
/*
/*Why am I getting the [undefined array element]??? And it almost seems
/*like the 2nd array is looping twice......where did I go wrong????
/*
/*
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314147
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4