[Newbies] How to sort a SortedCollection like you can sort a table in Excel?

keith keith_hodges at yahoo.co.uk
Tue Apr 13 13:11:15 UTC 2010


On 13 Apr 2010, at 01:03, Jerome Peace wrote:

> Hi Bert, Hi DeBruicker
> a slight tweak to Bert's method
>
> a height = b height
> ifFalse: [ a height < b height ]
>  ifTrue: [ a width = b width
>    ifFalse: [ a width < b width ]
>    ifTrue: [ a depth <= b depth ] ] .
>
> Basically if primary sorts values are unequal sort by primary values  
> else sort by secondry values etc. This basicly recusive procedure  
> will work for any number of sort levels.
>
> Yours in curiosity and service, --Jerome Peace
>


Hi Jerome,

If you look at my implementation you will probably hate it! For  
practical purposes, in my <= implementation for SequencableCollection  
I also handles nil <= anything else, and false <= true.

cheers

Keith


More information about the Beginners mailing list