CFileList:Count
The Count method returns the number of files in the CFileList object. This is often useful as a loop counter when iterating over the file list.
nFiles = CFindFiles:Count() nFiles is the number of files in the file list. Returns 0 if no files are found. |
The following script creates a CFileList object from the file named sFileName. Then it iterates through the file list, returning each name from the list. Note that Next returns the next file name as a string, so you should not hide its return value by using it as a loop counter.
|
-- Create a new CFileList from the file sFileName |
|
-- step through the file list |
|
-- save the next file name |
|
-- list the file name |
-- do something with the file name |
|
|
|
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.