Pascal Scripting: GetOpenFileNameMulti

Prototype:

function GetOpenFileNameMulti(const Prompt: String; var FileNameList: TStrings; const InitialDirectory, Filter, DefaultExtension: String): Boolean;

Description:

Displays a dialog box that enables the user to select one or more existing file(s). Returns True if the user selected a file, False otherwise. The name of the selected file(s) is returned in the FileNameList list.

Remarks:

An example Filter: 'Text files (*.txt)|*.txt|All files (*.*)|*.*'

Example:
var
  FileNameList: TStrings;
begin
  // Create the list
  FileNameList := TStringList.Create;
  try
    if GetOpenFileNameMulti('', FileNameList, '',
       'Text Documents (*.txt)|*.txt|All Files|*.*', 'txt') then
    begin
      // Successful; user clicked OK
      // FileNameList contains the selected filename(s)
    end;
  finally
    FileNameList.Free;
  end;
end;