In a two dimensional array the only thing you can append to the first
dimension is another 1-dimensional array. That means that in the loop you'd
need to build a one dimensional array then append it (or something
comparable)
This would work:
<cfset x = arrayNew(2)>
<cfloop from="1" to="20" index="i">
<cfset x[i] = arrayNew(1)>
<cfset trash = arrayAppend(x[i],"foo")>
<cfset trash = arrayAppend(x[i],"bar")>
</cfloop>
or this:
<cfset x = arrayNew(2)>
<cfloop from="1" to="20" index="i">
<cfset y = arrayNew(1)>
<cfset trash = arrayAppend(y,"foo")>
<cfset trash = arrayAppend(y,"bar")>
<cfset trash = arrayAppend(x,y)>
</cfloop>
+-----------------------------------------------+
Bryan Love
Database Analyst
Macromedia Certified Professional
Internet Application Developer
TeleCommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+
"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
- Thomas Paine, The American Crisis
"Let's Roll"
- Todd Beamer, Flight 93
-----Original Message-----
From: Matt Robertson [mailto:[EMAIL PROTECTED]
Sent: Monday, June 09, 2003 4:15 PM
To: CF-Talk
Subject: ArrayAppend with a 2d array?
Today is my day for dumb questions I suppose...
I've always appended to 2d arrays while in a loop, as part of the initial
array build process, so determining the first dimension value was never a
problem. Never needed to come back to them and append something later, but
I do now. All of the examples for ArrayAppend() are for 1d arrays. I can't
seem to cobble together a solution.
Any helpful pointers would be appreciated.
-------------------------------------------
Matt Robertson, [EMAIL PROTECTED]
MSB Designs, Inc. http://mysecretbase.com
-------------------------------------------
---------- Original Message ----------------------------------
From: "Matt Robertson" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: Mon, 9 Jun 2003 15:59:17 -0700
>Perfect. CFBREAK was just what I needed and couldn't find. Can't use a
conditional under the circumstances.
>
>Thx all,
>
>--Matt--
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community.
http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4