Coldfusion ArrayLen() Problem
Posted on 2004-10-21
I have an array of a structure from which I am already successfully outputting the correct number of results (where Arr_TotalResults[i].SOURCE IS "Gemini", which is outputting 5 rows because only 5 elements EQ Gemini). I now need to get the array length MINUS those which do not have a structure key SOURCE IS "Gemini". I thought the code below would do this because it is already working on the output, however, it's giving me the full length of the array (which is 11) and still including those which do not match 'Gemini'. Please can someone tell me what I'm doing wrong here??
<cfloop from="1" to="#arrayLen(Arr_TotalResults)#" index="i">
<cfif Arr_TotalResults[i].SOURCE IS "Gemini">