Build a structure (associative array) where you have
 the value you are trying to sort (array[x][5]) as the keyname
and the array[x]  as the keyvalue

***** untested code ahead *******

<cfset myStruct = StructNew()>
<cfloop from=1 to=ArrayLen(myarray) index=idx>
    <cfset result = StructInsert(myStruct, array[idx][5], array[idx])>
</cfloop>

<!--- Sort the array keynames ---->
<cfset KeyNames = StructKeyArray(myStruct)>
<cfset SortedKeys =  ArraySort(KeyNames, "textnocase", "desc")> <!--- or
what ever sort you want --->

<cfset MySortedArray = ArrayNew(1)>
<cfloop from=1 to=arraylen(SortedKeys) index=idx>
    <cfset MySortedArray[idx] = StructFind(myStruct,SortedKeys[idx])>
</cfloop>


or something like that , let me know how you get on ....

~Justin

----- Original Message -----
From: "Vincent" <[EMAIL PROTECTED]>
To: "cftalk" <[EMAIL PROTECTED]>
Sent: Friday, August 11, 2000 11:58 AM
Subject: Double Dimesion ArraySorting


> hi,
>     I was wondering .... how do I go about sorting a double dimension
array
> ?
>
> Consider the second dimension to be ranging from 1-10.
>
> ------ myarray[x][10]
>
>
> Now if I want to sort all the arrays in ascending order by the array[x][5]
> So that the order of the data myarray[x][1] ------ myarray[x][10] would
> remain
> intact...
>
> ...how do I go about doing something like that  ?
>
>
> Thanks
> vin
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>
>

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to