any existing units/libraries for sorting?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

any existing units/libraries for sorting?

Dennis
I have a list of records (each with a few fields).
I want to let users display this list of records in ascending orders of
any record field.
Is there any existing units/library I can use?

Thanks in advance.

Dennis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: any existing units/libraries for sorting?

Ryan Joseph
Determine the sorting key for each of the fields and use quick sort? If the field you’re sorting by is a name for example then use alphabetic order. Sounds like a generic sorting by comparison problem and doesn’t require any specific library.

> On Jan 3, 2018, at 10:09 PM, Dennis <[hidden email]> wrote:
>
> I have a list of records (each with a few fields).
> I want to let users display this list of records in ascending orders of any record field.
> Is there any existing units/library I can use?
>
> Thanks in advance.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: any existing units/libraries for sorting?

Santiago A.
In reply to this post by Dennis
El 03/01/2018 a las 16:09, Dennis escribió:
> I have a list of records (each with a few fields).

What do you mean with list?
A TList? You can use sort method

--
Saludos

Santiago A.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: any existing units/libraries for sorting?

Dennis Poon


Santiago A. wrote:
> El 03/01/2018 a las 16:09, Dennis escribió:
>> I have a list of records (each with a few fields).
> What do you mean with list?
> A TList? You can use sort method
>
Thanks for the reminder. I forgot about it.

Dennis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal