Re: extract values from arrays dynamically

2004-12-14 Thread Joy Holman
well, the 2nd dimension of the first array contains the # of answers to test 1 (again, minus 1 since the first element of the 2nd dimesion is specifying the test #). so loop over the first dimension and do an arrayLen() - 1 on the second dimension. cfoutput cfloop from=1

Re: extract values from arrays dynamically

2004-12-14 Thread Joy Holman
well, the 2nd dimension of the first array contains the # of answers to test 1 (again, minus 1 since the first element of the 2nd dimesion is specifying the test #). so loop over the first dimension and do an arrayLen() - 1 on the second dimension. cfoutput cfloop from=1

Re: extract values from arrays dynamically

2004-12-14 Thread Charlie Griefer
No worries. I'm still waiting for Joe R. to elaborate on the array of CFCs idea :) On Tue, 14 Dec 2004 13:59:34 -0400, Joy Holman [EMAIL PROTECTED] wrote: well, the 2nd dimension of the first array contains the # of answers to test 1 (again, minus 1 since the first element of the 2nd dimesion

Re: extract values from arrays dynamically

2004-12-10 Thread Joy Holman
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 Gold

Re: extract values from arrays dynamically

2004-12-10 Thread Joy Holman
Using this code: cfscript QstnKey = ArrayNew(3); QstnKey[1][1][1] = TEst1; QstnKey[1][2][1]=a. choice 1; QstnKey[1][2][2]=b. choice 2; QstnKey[1][2][3]=c. choice 3; QstnKey[1][3[1]=a. choice 1; QstnKey[1][3[2]=b. choice 2; QstnKey[1][3[3]=c. choice 3; QstnKey[2][1][1]=Test2; QstnKey[2][2][1]=a.

Re: extract values from arrays dynamically

2004-12-10 Thread Joe Rinehart
Joy, I'm not sure what your original message was, but if you need the size of an array, just do arrayLen(array). -joe 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

Re: extract values from arrays dynamically

2004-12-10 Thread Charlie Griefer
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

Re: extract values from arrays dynamically

2004-12-10 Thread Joe Rinehart
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

Re: extract values from arrays dynamically

2004-12-10 Thread Charlie Griefer
Hey Joe: First off, really been enjoying your blog postings on the OO stuff. keep it up :) Now...you've piqued my curiousity re: array of CFCs. I'm still grasping CFCs (conceptually...why/how/where/when to use them ('correctly')), so I'm curious as to how you'd use them in this setting. Each

Re: extract values from arrays dynamically

2004-12-10 Thread Charlie Griefer
well, the 2nd dimension of the first array contains the # of answers to test 1 (again, minus 1 since the first element of the 2nd dimesion is specifying the test #). so loop over the first dimension and do an arrayLen() - 1 on the second dimension. cfoutput cfloop from=1

Re: extract values from arrays dynamically

2004-12-10 Thread Joy Holman
I appreciate your answer and will look into using structures and CFC's, but in the meantime, the answer you gave to my question, I think is assuming that each question is a test. The situation is as below, where the first test has 2 questions and each question has three choices. Using this

extract values from arrays dynamically

2004-12-06 Thread Joy Holman
I need to dynamically extract all the select option choices for each question in a form. The number of choices for each question vary. I have a multi-dimensional array that stores the questsions and choices for each test like the array shown below: How can I create one piece of code that can

Re: extract values from arrays dynamically

2004-12-06 Thread Charlie Griefer
do you have to store the data like that? an array of structs seems like it would be easier to work with... cfset testArray = arrayNew(1) / cfset testArray[1] = structNew() / cfset testArray[1].testNumber = 1 / cfset testArray[1].answers = arrayNew(1) / cfset testArray[1].answers[1] = choice 1 /

Re: extract values from arrays dynamically

2004-12-06 Thread Joy Holman
Thanks, Charlie. I'll try that. ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186345 Archives: