> How do I sort an array and then work with the sorted information?  The
> combined documentation relating to this in both of the Forta books equates
> to about 10 lines.  The only output I can get from the arraysort
> function is
> a "yes" or a "no", and after it returns "yes" and I go back to call data
> from the "sorted" array - it's not sorted at all.  Am I wrong to
> think of a
> 2 dimensional array as a spreadsheet?  If I've got a 5 column, 2
> dimensional
> array - is there a syntax for sorting by, let's say, the 3rd column?  Here
> is what I have been trying:
>
> <cfset testarray = ArrayNew(2)>
> <cfset boom = 0>
> <cfset bang = 400>
>
> <cfloop index="boom" from="0" to="20">
> <cfset bang = bang + 1>
> <cfset testarray[ArrayLen(testarray)+1][1]="#boom#">
> <cfset testarray[ArrayLen(testarray)][2]="#bang#">
> </cfloop>
>
> <cfset testarray = arraysort(testarray[2], "numeric", "desc")>
>
> So what this is doing is setting a two column array, each
> containing numbers
> in an ascending fashion.  The arraysort function on the last line (which
> causes an error, hope you know what I'm attempting to do) is sorting the
> array by the second column in a descending order.  What am I doing wrong?
> CF4.51/w2kadvanced

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************

ArraySort is horrid and ugly - it only (seems) to sort single dimentioned
arrays, and either eats 2 dimentional ones, or does nothing

I had to write a sort routine for my 2 dimentional ones

If not, keep a dump database, make a table, insert the data, query it...
voila!

Ugly, but faster than writing your own sort routine.


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
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