RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.AnsiCompareFileName Function

Compares file names based on the current locale.

Pascal
function AnsiCompareFileName(const S1: string; const S2: string): Integer;
C++
int AnsiCompareFileName(const AnsiString S1, const AnsiString S2);

SysUtils

AnsiCompareFileName compares two file names. The current locale controls the compare operation. Comparison is case-insensitive under Windows, case-sensitive under Linux. 

The return value is:

Condition 
Return Value 
S1 > S2  
> 0  
S1 < S2  
< 0  
S1 = S2  
= 0  

AnsiCompareFileName supports the idiosyncrasies of MS-DOS file names that use Zenkaku Moji, a character encoding used in some Asian locales. Under Windows locales that do not use MBCS, AnsiCompareFileName is identical to AnsiCompareText. Under Linux, AnsiCompareFileName is identical to AnsiCompareStr

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!