[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'FileCtrl' (#lcl)

TCustomFileListBox.IndexOfFile

Gets the ordinal position for the specified file name in Items.

Declaration

Source position: filectrl.pp line 64

protected function TCustomFileListBox.IndexOfFile(

  const AFilename: string

):Integer;

Arguments

AFilename

  

File name to locate in Items.

Function result

Ordinal position in Items for the specified file name, or -1 when not found.

Description

IndexOfFile is an Integer function used to get the ordinal position for the specified file name in the list of file names in the control. AFilename contains the file name to locate in the method.

IndexOfFile handles drive and volume entries that may be stored in Items by ignoring the square brackets ([]) used to surround values with the corresponding file attributes. The CompareFileNames routine from LazFileUtils is used to perform file name comparisons.

The return value is -1 when AFilename is not stored in the Items property.

See also

TCustomListBox.Items

  

The list of all items defined in the control.

CompareFileNames


Version 4.0 Generated 2025-05-03 Home