multidiskscanner Example of changing the search rules at run-time
dcMultiDiskScanner component TDiskScanList class Search rules designers
Return to Introduction  Previous page  Next page
Following examples demonstrates how to change the IncludeList and ExcludeList searching rules at run-time of your application.

Let's say, we would like to find all picture files (BMP, JPG, JPEG and GIF) at location specified by PictureFolder variable, but would like to exclude all files that begins by "a" letter from search results. We don't want to search the files in subfolders under PictureFolder directory.  
with dcMultiDiskScanner do  
  with IncludeList do  
    Clear; // clear the IncludeList  
    AddPath(PicturesFolder + '\*.bmp', False); // False - don't include subfolders  
    AddPath(PicturesFolder + '\*.jpg', False);  
    AddPath(PicturesFolder + '\*.jpeg', False);  
    AddPath(PicturesFolder + '\*.gif', False);  
  with ExcludeList do  
    Clear; // clear the ExcludeList  
    AddPath('a*.*', False);  
//  AddPath(PicturesFolder + '\a*.*', False);  

See also
dcMultiDiskScanner component, TDiskScanList and TDiskScannerPath classes.