The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Class: none
Declaration: procedure ScanFilesToStrList (FileMask: string; SubDirs: boolean; SL: TStringList; Feedback: TScanFilesFeedback);

The procedure ScanFilesToStrList scans the disk for files whose name match the parameter FileMask. The search starts at the path specified by FileMask and recursively searches all subdirectories if the parameter SubDirs is TRUE. All filenames which match the FileMask are appended to the string list SL. Please note, that you have to explicitly clear the string list if you do not want to append the scanned files names to the existing strings in the string list.

The parameter FileMask may contains wildcards in the filename and extension but not in the path. The parameter FeedBack defines the feeback routine which is called whenever a subdirectory is entered during recursive search. If no feedback should be given, FeedBack should be set to nil.

The returned filenames contain paths in the same format as specified in the parameter FileMask. If FileMask is a full path, the filenames in the string list also contain the full paths, if FileMask specifies a relative path the returned files are also relative.

Example: This procedure is used in the following example program (see for downloading the code): jpg_browser

Last Update: 2013-Sep-20