[Gambas-user] A piece of code to sort an array of collections
Olivier Coquet
ocoquet at 3d-phenomen.fr
Fri Jan 22 08:43:32 CET 2021
Indeed, there was an error in the first code and I hadn't seen it.
In this line:
tmp_ar.Add(col[Colkey] & Chr(26) & i)
the [i] is missing at this point:
tmp_ar.Add(col*[i]*[Colkey] & Chr(26) & i)
My apologies, I don't know how this could have happened.
Friendship
Olivier
Le 21/01/2021 à 22:30, Jussi Lahtinen a écrit :
>
> > Collections are not guaranteed to keep order or so Benoit has
> said. I
> > don't know in what situation the order can change.
>
> They do: collections always enumerate its values in the order they
> were
> inserted.
>
> https://gambaswiki.org/wiki/comp/gb/collection/_next
> <https://gambaswiki.org/wiki/comp/gb/collection/_next>
>
>
> OK, thanks for the clarification. It seems there was miscommunication,
> he is sorting the array of collections, not the collections.
>
>
> Jussi
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210122/3d57c7d0/attachment.htm>
More information about the User
mailing list