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

Jussi Lahtinen jussi.lahtinen at gmail.com
Thu Jan 21 18:53:41 CET 2021


I believe you have working code, but it definitely is NOT the one you
posted. It does not work.
Moreover, collections shouldn't be sorted. They are not indexed.

Jussi


On Thu, Jan 21, 2021 at 9:39 AM Olivier Coquet <ocoquet at 3d-phenomen.fr>
wrote:

> 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
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210121/2470595b/attachment.htm>


More information about the User mailing list