[Lazarus] errors: Upper bound of case range is less than lower bound and duplicate case label

Hans-Peter Diettrich DrDiettrich1 at aol.com
Tue Jan 22 02:20:06 CET 2013

Avishai schrieb:
> Sorry, I'm late coming into this conversation and I may not be 
> understanding the question/answer.  But if I am, then 
> case sensitivity should be part of any sort/comparison, at least as an 
> option.  I have had many problems when it is not.  aA-Bb-Cc-dD is a form 
> of randomness.  If the result of a sort can not be reliably reproduced 
> after adding new data, the sort fails.  Case sensitive sort is common. 
>  Take a look at almost any spreadsheet program and you will see that it 
> is an option.  It's also an option in TStringList.  In my opinion Case 
> Sensitive should be the default behavior of any Sort/Comparison.

A case statement IMO should not rely on sort/compare options, unless 
there exists a syntax extension for such specifications. It also should 
be insensitive to string encodings (codepages).

If you want to be sure of the results, you replace the case statement by 
a chain of explicit comparisons, using the desired string comparison 


More information about the Lazarus mailing list