[Gambas-user] Sorting 2D arrays

Gianluigi bagonergi at gmail.com
Thu Sep 3 09:34:44 CEST 2020


Il giorno gio 3 set 2020 alle ore 02:28 T Lee Davidson <
t.lee.davidson at gmail.com> ha scritto:

> On 9/2/20 6:40 PM, Gianluigi wrote:
> > I don't understand the addition of composite key, here (*) you asked a
> specific question.
>
> John wants to sort the episodes by Series Name AND Episode Name. If we
> were dealing with a database table, we would create a
> composite index on those two columns. John has simply named the property
> CompositeKey.
>
>
Now I understand, thanks.

But this was already explained, there is no need to add a new array,
composite keys are formed like this:
Return Comp ($ sSeriesName & $ sEpisodeName, hSeries.SeriesName &
hSeries.EpisodeName)

And as has already been explained (demonstrated with the previous code) it
is possible to sort in Ascending or Descending order.

I enclose the last demonstration for John

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20200903/ee335f1f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RoseTest-4.zip
Type: application/zip
Size: 17291 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20200903/ee335f1f/attachment-0001.zip>


More information about the User mailing list