CFileList:Next
The Next method returns the next file name from the file list in the CFileList object.
sFileName = CFindFiles:Next() sFileName is the next file name in the file list. Returns nil when the end of the file list is reached. |
This method iterates to the next file in the file list. When the end is reached, nil is returned. Call Start to go back to the beginning of the file list.
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 |
|
|
|
CFileList, Open, Start, new_filelist
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.