I did something like this:
<cfscript>
for (x=1; x lt int(arraylen(MyArray)/2); x=x+1)
{
NewArray[x][1] = MyArray[(2 * x) - 1];
NewArray[x][2] = MyArray[2 * x];
}
</cfscript>
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
: From: Alex [mailto:[EMAIL PROTECTED]]
: Sent: Friday, August 16, 2002 10:51 AM
: To: CF-Talk
: Subject: Re: Array question...
:
:
: <cfscript>
: SingleArray = ArrayNew(1);
: SingleArray[1] = "One";
: SingleArray[2] = "Planes";
: SingleArray[3] = "Twelve";
: SingleArray[4] = "Jets";
:
: DoubleArray = ArrayNew(2);
: j=0;
: for (x = 1; x lt arraylen(SingleArray); x = x + 2) {
: j = j + 1;
: DoubleArray[j][1] = SingleArray[x];
: DoubleArray[j][2] = SingleArray[x+1];
: }
: </cfscript>
:
:
:
: On Fri, 16 Aug 2002, Dowdell, Jason G wrote:
:
: > I have a single dimensional array that I want to duplicate
: > into a 2 dimensional array. The first dimension are all odd
: > numbers in the array and the second dimension are all the
: > even numbers in the array.
: >
: > e.g.
: > Array as it exists now...
: > Array[1] = "One"
: > Array[2] = "Planes"
: > Array[3] = "Twelve"
: > Array[4] = "Jets"
: >
: > Array I want to make...
: > Array[1][1] = "One"
: > Array[1][2] = "Planes"
: > Array[2][1] = "Twelve"
: > Array[2][2] = "Jets"
: >
: > Any thoughts?
: >
: > ~Jason
: >
: > <!---
: > Jason Dowdell
: > [EMAIL PROTECTED]
: > 321.799.6845
: > IM AES - Web Developer
: > --->
: >
: >
:
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists