Files.Find

Top  Previous  Next

 

Syntax

function Files.Find(var ResultList: array; Path: string; FileFilter: string; FindCmds: integer): integer

 

Alternative Names

ibec_GetFiles

 

Description

Peforms a file search based on the given parameters. ResultList is an array that will receive the result. Path is the initial file path for the search. FileFilter allows for filtering what files to search for and FindCmds is zero or a combination of one of the following to control the search and the results:

 

__ffRecursiveSearch

Search will be performed recursively, subfolders of the given folder will be searched as well.

__ffFullName

The file-names in the resulting list will include full path information.

__ffAppend

Append the items to the result list, instead of clearing the list first.

__ffSort

Sort the list of files in the result list.

__ffDirectories

Search for folders instead of files.

 

This routine returns the number of files found during the search.

 

See also

Array.Create

 

Example

execute udsblock returns (file_found varchar(1024))

as

begin

  found_files = null;

  

  resultint = Files.Find(found_files, 'c:\windows', '*.ini', /*__ffRecursiveSearch + */__ffFullName);

  

  GUI.ShowMessage('Found files: ' || resultint);

  

  foreach (found_files as found_filename)

  do begin

       file_found = found_filename;

   suspend;

     end;

end