Ignore:
Timestamp:
May 30, 2023, 11:31:10 AM (11 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from unit names.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/FindFile.pas

    r455 r456  
    66Tired of using FindFirst, Next and Close?
    77Come see how to encapsulate all those functions
    8 in A Single "find-files-recursively" component.
     8in a single "find-files-recursively" component.
    99It's easy to use, free and with code.
    1010
     
    1919}
    2020
    21 unit UFindFile;
     21unit FindFile;
    2222
    2323interface
     
    3434  TFindFile = class(TComponent)
    3535  private
    36     S : TStringList;
    37     fSubFolder : Boolean;
     36    s : TStringList;
     37    fSubFolder : boolean;
    3838    fAttr: TFileAttrib;
    3939    fPath : string;
     
    4747  published
    4848    property FileAttr: TFileAttrib read fAttr write fAttr;
    49     property InSubFolders : Boolean read fSubFolder write fSubFolder;
     49    property InSubFolders : boolean read fSubFolder write fSubFolder;
    5050    property Path : string read fPath write SetPath;
    5151    property FileMask : string read fFileMask write fFileMask ;
     
    7979  FileMask := FilterAll;
    8080  FileAttr := [ffaAnyFile];
    81   S := TStringList.Create;
     81  s := TStringList.Create;
    8282end;
    8383
    8484destructor TFindFile.Destroy;
    8585begin
    86   S.Free;
    87   inherited Destroy;
     86  s.Free;
     87  inherited;
    8888end;
    8989
     
    101101function TFindFile.SearchForFiles: TStringList;
    102102begin
    103   S.Clear;
     103  s.Clear;
    104104  try
    105105    FileSearch(Path);
    106106  finally
    107     Result := S;
     107    Result := s;
    108108  end;
    109109end;
     
    111111procedure TFindFile.FileSearch(const InPath : string);
    112112var Rec  : TSearchRec;
    113     Attr : Integer;
     113    Attr : integer;
    114114begin
    115115  Attr := 0;
     
    125125  try
    126126    repeat
    127       S.Add(inPath + Rec.Name);
     127      s.Add(inPath + Rec.Name);
    128128    until SysUtils.FindNext(Rec) <> 0;
    129129  finally
     
    143143    SysUtils.FindClose(Rec);
    144144  end;
    145 end; 
     145end;
    146146
    147147end.
    148 
Note: See TracChangeset for help on using the changeset viewer.