IFileInfoList.Item

Syntax

Item(Index: Integer): IFileInfo;

Parameters

Index - index of a collection element.

Description

The Item property returns description of an element in the collection.

Example

Sub UserProc;
Var
    DirInfo: IDirectoryInfo;
    FileList: IFileInfoList;
    s: String;
Begin
    DirInfo:=New DirectoryInfo.Attach("c:\New_folder");
    If DirInfo.Exists Then
        FileList:=DirInfo.GetFiles("*");
        s:=FileList.Item(0).Name;
    End If;
    Dispose DirInfo;
End Sub UserProc;

After executing the example the "s" variable contains name of the first file in the directory C:\New_folder.

See also:

IFileInfoList