In experimenting with a 2 dimensional array I used Pascal's coding
example and have the below code now (which works and generates the
correct output) but I don't understand the loop mechanics.

For example:  when I enter 8 cassettes in the form feeding this array, I
get the following output, which is correct, but don't know why--... can
someone breakdown how the cfloops below work? (for instance I thought
this output would relect 8 records, not 1).  I get totally lost with the
2nd loop ... then one loop is wrapped within another -- whoa!
thanks in advance

OUTPUT:
Record 1
iss1,iss2,iss3,iss4,iss5,iss6,iss7,iss8
cass1,cass2,cass3,cass4,cass5,cass6,cass7,cass8
date1,date2,date3,date4,date5,date6,date7,date8
pub1

<cfset cassettes_Array=ArrayNew(2)>
<cfset cassettes_Array[ArrayLen(cassettes_Array)+1][1]=form.issue>
<cfset cassettes_Array[ArrayLen(cassettes_Array)][2]=form.title>
<cfset cassettes_Array[ArrayLen(cassettes_Array)][3]=form.date1>
<cfset cassettes_Array[ArrayLen(cassettes_Array)][4]=form.publication>

<cfoutput>
<cfloop from="1" to="#ArrayLen(cassettes_Array)#" index="i"> Record
#i#<br/>
<cfloop from="1" to="#ArrayLen(cassettes_Array[i])#" index="j">
#cassettes_Array[i][j]#<br/>
</cfloop>
</cfloop>
</cfoutput>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to