On Thu, Jul 7, 2016 at 10:58 AM, Joseph Alotta <
[hidden email]> wrote:
> Greetings,
>
> I have a collection of Transaction objects. They have instance variables of category and payee.
>
> A category might be “Office Expense” and a payee might be “Costco” or “Amazon”.
>
> I want to sort by categories and then payees.
>
> Office Expense, Amazon…..
> …..
> ….
> ….
> Office Expense, Costco
> ….
> …
> …
>
> Here is some of my code:
>
>
>
> sorted := trans asSortedCollection: [:a :b | (a category) < (b category)].
Just guessing...
[:a :b | (a category) = (b category)
ifFalse: [ (a category) < (b category) ]
ifTrue: [ (a payee) < (b payee)]].
cheers -ben
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners