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

Andreas Raab andreas.raab at gmx.de
Mon Apr 12 16:52:41 UTC 2010


On 4/12/2010 7:48 AM, Bert Freudenberg wrote:
> Hmm, indenting it like this makes it more obvious:
>
> 	a height>  b height or: [
> 	a height = b height and: [
> 		a width>  b width or: [
> 		a width = b width and: [
> 			a depth>  b depth]]]]

Personally, I write multi-level sort blocks like here:

	a height = b height
		ifTrue:[a width = b width
			ifTrue:[a depth >= b depth]]
			ifFalse:[a width >= b width]
		ifFalse:[a height >= b height]

Cheers,
   - Andreas


More information about the Beginners mailing list