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

Adam Cantrell


------------------------------------------------------------------------------
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