[fpc-devel] Stringlist sortstyle ssluser

Franz Müller office at focusdata.at
Thu Dec 27 14:01:18 CET 2018


On Wed, 26 Dec 2018, Franz Müller wrote:

> In the current implementation of TStringlist, there is a property 
> SortStyle, which is somewhat similar to the property Sorted. However, 
> it is different from sorted in that it allows 3 values: sslnone, which 
> corresponds to sorted=false, sslAuto, which corresponds to 
> sorted=true, and sslUser, which correspnds to ????
>
> This third value introduces some inconsistency. If the user is 
> responsible for sorting, as is written in the documentation, this must 
> be meant to be done by caling customsort - otherwise it would make 
> absolutey no sense to leave sorting to the user.

Not correct, it is meant for the cases when the user knows the list is 
sorted.

> And in addition the procedures used for comparing auto-sorted 
> procedures are local to the Stringlist unit, so the application 
> programmer would not even be able to use these methods for sorting 
> himself.

No, because you can load data from an already sorted file. Then it makes 
no sense to sort again.

Michael.

Ok, then I understand the meaning of sslUser. In that case, however, the 
documentation is somewhat misleading or at least ambiguous. It should 
state clearly that lists in which a user defined customsort has been 
called have to keep SortStyle=sslNone and that sslUser is not meant for 
such custom sorted lists.

Franz



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20181227/8bc89997/attachment.html>


More information about the fpc-devel mailing list