Changeset 515 for Common/UCommon.pas


Ignore:
Timestamp:
Jun 5, 2018, 11:02:54 AM (6 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/UCommon.pas

    r510 r515  
    7373function LoadFileToStr(const FileName: TFileName): AnsiString;
    7474procedure SearchFiles(AList: TStrings; Dir: string;
    75   FilterMethod: TFilterMethodMethod);
     75  FilterMethod: TFilterMethodMethod = nil);
    7676function GetStringPart(var Text: string; Separator: string): string;
    7777
     
    524524
    525525procedure SearchFiles(AList: TStrings; Dir: string;
    526   FilterMethod: TFilterMethodMethod);
     526  FilterMethod: TFilterMethodMethod = nil);
    527527var
    528528  SR: TSearchRec;
     
    532532    try
    533533      repeat
    534         if (SR.Name = '.') or (SR.Name = '..') or not FilterMethod(SR.Name) or
    535           not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name) then Continue;
     534        if (SR.Name = '.') or (SR.Name = '..') or (Assigned(FilterMethod) and (not FilterMethod(SR.Name) or
     535          not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name))) then Continue;
    536536        AList.Add(Dir + SR.Name);
    537537        if (SR.Attr and faDirectory) <> 0 then
Note: See TracChangeset for help on using the changeset viewer.