CFileList:Open

CFileList:Start


The Start method begins iteration for the CFileList object. Use this to restart after using Next to step through some number of files in the file list.

Syntax

CFileList:Start()

bullet.gif    This method has no parameters or return value.

Example

The following script opens a file list from the file named sFileName. It then skips to the 4th file and retrieves its name. The CFileList object is then reset to iterate over the entire file list:

F = new_filelist( sFileName )

-- create a CFileList from the file sFileName 

if F:Count < 4 then Exit() end

-- exit if not 4 or more files

for n = 1, 3 do

-- step through the first 3 files

  F:Next()

-- dump the file name

end

 

s4thName = F:Next()

-- retrieve the 4th file name

F:Start()

-- reset the file list to the beginning

for n = 1, F:Count() do

-- step through the file list

  str = F:Next()

-- save the file name for use

  -- do something with the file

 

end

 

Related Topics

CFileList class, Next


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.