Well from what I can see, you're trying to work with a 2 dimentionnal array
when you only define one dimesion for it. I aint got an example handy but
basicly, here is how I see it..

<cfset testarray = ArrayNew(2)(2)>

in your example here is what you were doing:

<cfset testarray[ArrayLen(testarray)+1][1]
 Dimension 1 -------------------^                  ^
 Dimension 2 -----------------------------------|

BTW: Dimesion 1 isn't necessary....

Dan


----- Original Message -----
From: "Adam Cantrell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 27, 2000 6:30 PM
Subject: sort an array


> I'm trying to sort an array by a certain column.  The documentation in
> either of Forta's books only span about 2 or 3 pages on working with
arrays
> so I'm wondering if anybody out there can point me to some examples of
> working with these.  I am having no problem with all of the other
functions,
> but no matter how I have been experimenting with sorting - it's not
working
> right.  Thanks.  Here is what I was thinking should display a number "420"
:
>
>
> <cfset testarray = ArrayNew(2)>
>
> <cfset boom = 0>
> <cfset booya = 400>
>
> <cfloop index="boom" from="0" to="20">
>     <cfset booya = booya + 1>
>     <cfset testarray[ArrayLen(testarray)+1][1]="#boom#">
>     <cfset testarray[ArrayLen(testarray)][2]="#booya#">
> </cfloop>
>
> <!--- so now I want to sort the second column in descending order --->
>
> <cfset newarray = arraysort(testarray[2], "numeric", "desc")>
>
> <cfoutput>
>     #newarray[1][2]#
> </cfoutput>
>
> --------------------------------------------------------------------------
----
> 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.

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