sorting elements in OrderedCollection

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

sorting elements in OrderedCollection

sergio_101-2
if i have an OrderedCollection, how would i go about spitting them out
sorted on one of the variables?

ie.

if i have people, which is a list of person(s), how would i spit out a
list sorted by last name?

thanks!

--

----
peace,
sergio
photographer, journalist, visionary

http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: sorting elements in OrderedCollection

Randal L. Schwartz
>>>>> "sergio" == sergio 101 <[hidden email]> writes:

sergio> if i have people, which is a list of person(s), how would i spit out a
sergio> list sorted by last name?

collection asSortedCollection: [:a :b | a lastName <= b lastName ]

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners