[fpc-devel] Questions on TStringList.Find change (Mantis 28744)

C Western l at c-m-w.me.uk
Sat Mar 26 12:59:38 CET 2016


On 26/03/16 09:19, Michael Van Canneyt wrote:
> I have implemented a new property
>
>   TStringsSortStyle = (sslNone,sslUser,sslAuto);
>
>   Property SortStyle : TStringsSortStyle Read FSortStyle Write
> SetSortStyle;
>
> I assume the meaning is clear.
>
> - Sorted is true if SortStyle is in [sslUser,sslAuto], so it reflects
> actual state.
>
> - Setting sorted to True is equivalent to setting SortStyle = sslAuto
>
> - Setting sorted to false is equivalent to setting SortStyle = sslNone
>
> - Find will work on one of those values, but it will raise an exception
> if sortstyle = sslnone
>
> - Add will put a new string on the 'correct' place if SortStyle=sslAuto
>
> - Insert will raise an error (as it was) if SortStyle=sslAuto.
>
> Michael.

I think you might have missed updating a file:

bootstrap/ppcx64 -Ur -gl -Ur -Xs -O2 -n -Fi../inc -Fi../x86_64 
-Fi../unix -Fix86_64 -FE. 
-FU/home/ctcmw/fpc/trunk.w/fpcsrc/rtl/units/x86_64-linux -Cg -dx86_64 
-dDEBUG -dRELEASE -Fi../objpas/classes ../unix/classes.pp
stringl.inc(1447,29) Error: Identifier not found "SErrFindNeedsSortedList"

On a related matter - is this insensitive to changes in the system/rtl 
sort order? I had a difficult to find problem recently where I had some 
code in an initialization section that prepared a sorted string list (or 
something like it). The use of this in the main program then broke when 
I added another package to the program (in fact fpSpreadsheet) that 
forced inclusion of cwstrings to the program, but implicitly after the 
initialization discussed. This was easily fixed by adding cwstrings at 
the top of the lpr file. I am not sure if this is something that can be 
more generally fixed, but if there is anything that can reduce the 
possibilities for confusion that would be good.

Colin




More information about the fpc-devel mailing list