CFileList:Close


The Close method closes file searching for the CFileList object and frees memory. It does not delete the CFileList object.

Syntax

CFileList:Close()

Example

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.

F = new_filelist( sFileName )

-- Create a new CFileList from the file sFileName

while n = 1, F:Count() do

-- step through the file list

  str = F:Next()

-- save the next file name

  Printf("%s\r\n", str )

-- list the file name

  -- do something with the file name

 

  n = n + 1

 

end

 

F:Close()

-- close the attached file list but retain object F

-- get the name of a different file list

 

F:Open( sFileName2 )

-- open the new file listwith the same CFileList object

-- do something else

 

Related Topics

CFileList

Open


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