[Gambas-user] A piece of code to sort an array of collections

Olivier Coquet ocoquet at 3d-phenomen.fr
Thu Jan 21 08:38:12 CET 2021


Sorry my English is not very good,
In fact, this function does not sort the array but the collections it 
contains.
In other words, if a collection array contains several collections, the 
collections are not necessarily in order.
For example:
let's imagine an array that contains three collections composed of three 
key/value pairs (name/surname/town).
This function will sort the collections in alphabetical order on any key.
If you want to have the collections in the order of towns, just specify 
"town" in the function call, and the collections will be sorted on the 
key "town".
As far as I know, no Gambas function does that, and yet it is very 
convenient.

Friendship
Olivier

Le 20/01/2021 à 19:57, Jussi Lahtinen a écrit :
> No, I meant this; col[Colkey]. The Colkey as string.
> And no, look more closely, what I said holds.
>
> Jussi


More information about the User mailing list