[fpc-pascal] sort procedure of T(FP)List

Marc Santhoff M.Santhoff at t-online.de
Sat May 6 16:10:36 CEST 2006


Am Freitag, den 05.05.2006, 11:03 +0300 schrieb Geno Roupsky:
> In fact you could have different function for every kind of sort and
> switch them on the fly when the properties determining the kind of
> sort that should be made changes. In my experience there is no much
> code duplication involved in this technique and you could make for
> example one compare function for every field, after that you make a
> _complex_ ones calling the simple ones. 

The only thing I'm afraid of is stumbling into threading issues in the
future (most likely when I have fogotten the details of sorting ;).

> Either way it is not very OO based approach but of course you could
> make a descendand class of tfplist and add you own sorting code.

This is what I did.

Thanks,
Marc





More information about the fpc-pascal mailing list