"r00t" == r00t uk r00tuk@gmail.com writes:
r00t> I have a Dictionary object containing key value objects. I want to be r00t> able to retrieve the key-values by sort order on the key field. Any r00t> ideas or pointers would be greatly appreciated. At the moment r00t> everything is being returned unsorted.
r00t> The key field is a year date and the value a URL to that year's archive.
This might be a bit perverse, but if you flatten the dictionary into an OrderedCollection of Associations, you can sort those:
yourDictionary associations asSortedCollection do: [:each | year := each key. url := each value. ... ]
Browse the protocol of Association to know why #< does the right thing for a sort.
There might be a far better way.. but I found this in a few minutes.