CFindFiles:Start


The Start method re-initializes the file name iteration after files were already iterated. You can then use the Next method to retrieve each file name. Since the target folder and file name template are stored by the class, this method is a simpler alternative for reinitializing the Next iteration without calling Open and passing the same target folder and file name template.

Syntax

CFindFiles:Start()

bullet.gif    This method has no parameters and returns nothing.

Remarks

This method re-initializes the file name iteration after files have been found and after the names have been iterated. Normally, iteration is ready for the Next method after the Open method is called. See the Next method for more information.

Example

The following script makes a second pass through the file name list by re-starting the iteration using the Start method:

F = new_findfiles()

-- Create a new CFindFiles object

F:Open( sFolder, "h*.fts" )

-- specify thefolder and template

while F:Next() do

-- Iterate through the file names

  Printf("%s\r\n", F:GetPath() )

-- list each path name

end

 

-- do something with the file names

 

F:Start()

-- Reinitialize the iteration

while F:Next() do

-- Iterate through the files again

  Printf("%s\r\n", F:GetPath() )

-- list the current path name

end

 

 

 

F:Close()

-- finished with this object

Related Topics

CFindFiles, Open, Next


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