IDirectoryInfoList.Item

Syntax

Item(Index: Integer): IDirectoryInfo;

Parameters

Index - index of a collection element.

Description

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

Example

Sub Main;

Var

DirInfo: IDirectoryInfo;

DirList: IDirectoryInfoList;

s: String;

Begin

DirInfo:=New DirectoryInfo.Attach("c:\New_folder");

If DirInfo.Exists Then

DirList:=DirInfo.GetDirectories("*");

s:=DirList.Item(0).Name;

End If;

Dispose DirInfo;

End Sub Main;

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

See also:

IDirectoryInfoList