CFileDlg:Open CFileDlg:Next

CFileDlg:Start


The Start method begins iteration over the list of file names returned by the Open method.

Syntax

CFileDlg:Start()

  • This method has no parameters or return value.

Remarks

This method initializes the iteration for fetching the file names selected in the Open dialog. Use the Next method to return each of the successive file names.

Example

The following example uses Start to initialize a loop over files returned by the Open method:

F = CFileDlg:new()

-- create a CFileDlg object, F

 

F.bSetMaxFiles = true

-- set the flag for selecting more than 1 file

F.nMaxFiles = 100

-- allow selecting up to 100 files

sName, bSuccess = F:Open()

-- get a file name

-- create a table to hold the names of the selected files

FileName = {}

-- create the table

n = 1

-- setup an index counter

F:Start()

-- initialize the file name iteration

while true do

-- loop through the selected files:

  FileName[n] = F:Next()

-- put file name into table

  n = n + 1

-- increment the table index

end

 

Related Topics

CFileDlg, Open, Next