From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function AnsiStrLComp(S1, S2: PAnsiChar; MaxLen: Cardinal): Integer;
function AnsiStrLComp(S1, S2: PWideChar; MaxLen: Cardinal): Integer;


extern DELPHI_PACKAGE int __fastcall AnsiStrLComp _DEPRECATED_ATTRIBUTE1("Moved to the AnsiStrings unit") (char * S1, char * S2, unsigned MaxLen)/* overload */;


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


Warning: Ansi version of AnsiStrLComp is deprecated. Please use AnsiStrings unit.

Compares the first MaxLen bytes of two null-terminated strings, case-sensitively.

AnsiStrLComp compares S1 to S2, with case sensitivity. If S1 or S2 is longer than MaxLen bytes, AnsiStrLComp only compares the first MaxLen bytes. The comparison operation is controlled by the current locale. The return value is one of the following.

Condition Return Value

S1 > S2

> 0

S1 < S2

< 0

S1 = S2 (up to MaxLen characters)

= 0

Note: This function supports multi-byte character sets (MBCS).

Note: AnsiStrLComp can continue the comparison beyond a null terminating character if S1 and S2 are equal up to a null character and the null character occurs before MaxLen bytes.

Note: Most locales consider lowercase characters to come before corresponding uppercase characters. This is in contrast to ASCII order, in which lowercase characters come after uppercase characters.

See Also