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