Page 1 of 1

PostPosted: Wed Dec 18, 2002 11:32 am
by cees_alberts
Is it possible to sort a dictionary?

Is there a way to use the orbsort native add-in to sort dictionaries?

PostPosted: Thu Dec 19, 2002 5:02 am
by dewey
A dictionary is not a sorted object - it is indexed by string rather than number. Perhaps you mean sorting a StringList? If so, you cannot do that from a native library (since you can't access the private data structures behind it), but I can add that as a feature request for the next new version.

PostPosted: Thu Dec 19, 2002 11:25 am
by cees_alberts
In my application I'm using the dict type as a dictionary; for instance with an english-spanish wordlist. Now I want to be able to show a sorted wordlist in a UIList.

Showing a sorted list would be an important feature in my application but I'm probably using the wrong datatype/object for that. It's probably best to change the dict type to an array of structures (holding the foreign word and the translation) because I can sort that with the sort addin(?)

Is it, by the way, possible to sort a UIList because that would also solve my problem?

PostPosted: Thu Dec 19, 2002 9:27 pm
by dewey
UILists cannot be sorted by the OS, though this could be added at a cost by our UIList implementation. Using an array of structures is probably the best thing for you to do regardless.