This will get number of questions in each test (note: if you're pre MX, wrap the second arrayLen() in evaluate()).
<cfoutput> <cfloop from="1" to="#arrayLen(QstnKey)#" index="i"> Questions in #QstnKey[i][1][1]# = #arrayLen(QstnKey[i]) - 1#<br /> </cfloop> </cfoutput> I think this is a really difficult way of going about doing it, and Charlie's right, an array of structs would be better. An array of CFCs would be even more ideal. For the array of structs, I'd do this: <cfscript> QstnKey = ArrayNew(1); QstnKey[1] = StructNew(); QstnKey[1].Name = "Test1"; QstnKey[1].Questions = ArrayNew(1); QstnKey[1].Questions[1] = StructNew(); QstnKey[1].Questions[1].Question = "What do you like about food?"; QstnKey[1].Questions[1].Answers = ArrayNew(1); QstnKey[1].Questions[1].Answers[1] = "a. choice 1"; QstnKey[1].Questions[1].Answers[2] = "a. choice 2"; // And so on... </cfscript> -joe On Fri, 10 Dec 2004 13:16:20 -0700, Charlie Griefer <[EMAIL PROTECTED]> wrote: > in looking at your original code...arrayLen(QstnKey[1])-1 should do it > (the -1 because one of the elements in the array is identifying it as > "Test1") > > i still think the array of structs is cleaner tho :) > > > On Fri, 10 Dec 2004 15:08:50 -0400, Joy Holman <[EMAIL PROTECTED]> wrote: > > I got the answer using my original code. > > Today my question is: > > Using that original code, how can I dynamically determine how many > > questions are in Test1? The answer would be "2". > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Special thanks to the CF Community Suite Silver Sponsor - New Atlanta http://www.newatlanta.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187087 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

