IDirectoryInfoList.Count

Syntax

Count: Integer;

Description

The Count property returns the number of elements in the collection.

Example

Sub UserProc;
Var
    DirInfo: IDirectoryInfo;
    DirList: IDirectoryInfoList;
    i: Integer;
Begin
    DirInfo:=New DirectoryInfo.Attach("c:\New_folder");
    If DirInfo.Exists Then
        DirList:=DirInfo.GetDirectories("*");
        i:=DirList.Count;
    End If;
    Dispose DirInfo;
End Sub UserProc;

After executing the example, the "i" variable contains the number of subdirectories in the directory c:\New_folder.

See also:

IDirectoryInfoList