Count: Integer;
The Count property returns number of elements in a collection.
Sub Main;
Var
DirInfo: IDirectoryInfo;
FileList: IFileInfoList;
i: Integer;
Begin
DirInfo:=New DirectoryInfo.Attach("c:\New_folder");
If DirInfo.Exists Then
FileList:=DirInfo.GetFiles("*");
i:=FileList.Count;
End If;
Dispose DirInfo;
End Sub Main;
After executing this example, variable "i" contains number of files in the directory c:\New_folder.
See also: