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
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
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
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
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.
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
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
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
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
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
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
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
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 /
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:
14 matches
Mail list logo