[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

CompareFileExt

Performs a sort order comparision for the specified file name and extension

Declaration

Source position: lazfileutils.pas line 31

function CompareFileExt(

  const Filename: string;

  const Ext: string;

  CaseSensitive: Boolean = False

):Integer;

Arguments

Filename

  

File name for the comparision

Ext

  

File extension for the comparison

CaseSensitive

  

True if case sensitive comparison is needed

Function result

Relative sort order for the compared values

Description

CompareFileExt is an Integer function used to compare the file extension in FIlename to the value in Ext. Ext may contain the '.' character, but it is not required and will be removed for the comparison. CaseSensitive indicates whether case is ignored in the comparision. When CaseSensitive contains True, CompareStr is called to perform the comparison. Otherwise, UTF8CompareText is called to compare the values. The return value will contain one of the following:

-1
Filename value has a lower sort order value than Ext
0
Filename and Ext have the same sort order values
1
Filename value has a higher sort order value than Ext

The return is 1 if Filename does not contain a file extension.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.