CFileList:Open
The Open method attaches a file list to the CFileList object. THis may be used to open a new file list into the existing CFileList object, or it may be used to attach a file list when the CFileList object was created without specifying the file name. Note that Open is automatically called when the CFileList object is created with a file specified.
bSuccess = CFindFiles:Open( sFileName ) sFileName is the name of the file containing the file list. On success, bSuccess is returned as true. |
Call this method to attach a new file list to the existing CFileList object. The files can be collected by iterating over the list using Next. Usually, the file list is passed to the new constructor. After you have exhausted the list, you can restart the iterator by calling Start.
The following script lists files from a file list in the file named sFileList. First, it creates an empty CFileList object that is not attached to a file. The file containing the file list is then attached using the Open command. 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 empty CFileList without a file name |
|
-- specify the name of the file list |
|
-- step through the files |
|
-- get the next file name |
|
|
CFileList, new_filelist, Next, Start
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.