CaseAnsiCompareText function
String / Filename routines
Return to Introduction  Previous page  Next page
Unit
acUtils  

Declaration
function CaseAnsiCompareText(const S1, S2: String; CaseSensitive: Boolean = True): Integer;  

Description
The CaseAnsiCompareText compares S1 to S2, with case sensitivity if CaseSensitive parameter is True. The compare operation is controlled by the current Windows locale. CaseAnsiCompareText returns a value less than 0 if S1 < S2, a value greater than 0 if S1 > S2, and returns 0 if S1 = S2.  

Original Code
function CaseAnsiCompareText(const S1, S2: String; CaseSensitive: Boolean {$IFDEF D4} = True {$ENDIF}): Integer;  
begin  
  if CaseSensitive then  
    Result := AnsiCompareStr(S1, S2)  
  else  
    Result := AnsiCompareText(S1, S2);  
end;