Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-04

Base db-indexes on ansicomparestring?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joost van der Sluis

Another question:

Should we base the indexes on AnsiCompareStr (like TStringList does) or CompareStr by default?

Joost

Michael Van Canneyt
to Joost van der Sluis
Joost van der Sluis wrote
Another question: Should we base the indexes on AnsiCompareStr (like TStringList does) or CompareStr by default?

? On straight string compare, it should be case sensitive.

Delphi has the idxCaseInsensitive index option for case insensitive strings, if I'm correct.

Michael.

Joost van der Sluis
to Michael Van Canneyt

Op zaterdag 19-04-2008 om 22:10 uur [tijdzone +0200], schreef Michael Van Canneyt:

Show quoted text 11 lines
On Sat, 19 Apr 2008, Joost van der Sluis wrote: > Another question: > > Should we base the indexes on AnsiCompareStr (like TStringList does) or > CompareStr by default? ? On straight string compare, it should be case sensitive. Delphi has the idxCaseInsensitive index option for case insensitive strings, if I'm correct.

This has nothing to do with case-insensitivity. AnsiCompareStr (case sensitive) and AnsiCompareText (case-insensitive) use the registered (wide)string manager to compare strings. That mean that on linux, for example, the results are different when cwstrings is used.

CompareStr (case sensitive) and CompareText (case insensitive) just perform a binary-compare, which is always the same but doesn't take the encoding in account...

Joost.