[fpc-pascal]A good array sorting unit?
Michael Van Canneyt
michael.vancanneyt at wisa.be
Fri Jul 20 09:28:46 CEST 2001
On Fri, 20 Jul 2001, Michael Lang wrote:
> Under DOS, I used the wonderful TpSort unit of Turbo Professional to
> sort stuff. Does anybody here know of a unit, which works under Free
> Pascal and has similar features. I need to sort arrays and I'd like to
> be able to give the sorting algorithm the address of a function,
> which I can write on my own, and which is then used by the sorting
> function to do the trick. This works great with TpSort. For instance
> with TpSort, I can write a function which sorts using several fields
> of the array (first by name, then by date) etc.
The TStringList class of the FCL (unit classes) supports a custom sort
algorithm; (By default, QuickSort is used.) this can be used to make an
optimal sort for the data you're using.
Michael.
More information about the fpc-pascal
mailing list