I'm pretty sure that'll reverse the whole string, not the list
elements, so you if you started with ["ab, "cd", "ef"], you'd end up
with ["fe", "dc", "ba"], rather than the correct ["ef", "cd", "ab"].
I don't know if it would work correctly with dates either, since
they'd be converted to strings, but wouldn't be converted back to
dates.  The Collections.sort method, on the other hand, doesn't touch
the objects, so neither problem would exist.

cheers,
barneyb

On Thu, May 8, 2008 at 9:42 AM, Dominic Watson
<[EMAIL PROTECTED]> wrote:
>> It used to be possible to reverse an array, at least in CF6 and CF7 using 
>> the Reverse method
>
> Reverse() is for reversing a string:
>
> http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000616.htm
>
> Here's a little udf for reversing an array using the Reverse() method:
>
> <cfscript>
>    function ReverseArray(arr){
>        return ListToArray(Reverse(ArrayToList(arguments.arr)));
>    }
> </cfscript>
>
> Perhaps there's a better way, i.e. using the java.utils.collection
> reverse method that Barney showed, but this seems straightforward to
> me.
>
> Dominic
>
> --
> Blog it up: http://fusion.dominicwatson.co.uk
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:304919
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to