Changeset 456 for trunk/Packages/Common/FindFile.pas
- Timestamp:
- May 30, 2023, 11:31:10 AM (18 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/FindFile.pas
r455 r456 6 6 Tired of using FindFirst, Next and Close? 7 7 Come see how to encapsulate all those functions 8 in A Single "find-files-recursively" component.8 in a single "find-files-recursively" component. 9 9 It's easy to use, free and with code. 10 10 … … 19 19 } 20 20 21 unit UFindFile;21 unit FindFile; 22 22 23 23 interface … … 34 34 TFindFile = class(TComponent) 35 35 private 36 S: TStringList;37 fSubFolder : Boolean;36 s : TStringList; 37 fSubFolder : boolean; 38 38 fAttr: TFileAttrib; 39 39 fPath : string; … … 47 47 published 48 48 property FileAttr: TFileAttrib read fAttr write fAttr; 49 property InSubFolders : Boolean read fSubFolder write fSubFolder;49 property InSubFolders : boolean read fSubFolder write fSubFolder; 50 50 property Path : string read fPath write SetPath; 51 51 property FileMask : string read fFileMask write fFileMask ; … … 79 79 FileMask := FilterAll; 80 80 FileAttr := [ffaAnyFile]; 81 S:= TStringList.Create;81 s := TStringList.Create; 82 82 end; 83 83 84 84 destructor TFindFile.Destroy; 85 85 begin 86 S.Free;87 inherited Destroy;86 s.Free; 87 inherited; 88 88 end; 89 89 … … 101 101 function TFindFile.SearchForFiles: TStringList; 102 102 begin 103 S.Clear;103 s.Clear; 104 104 try 105 105 FileSearch(Path); 106 106 finally 107 Result := S;107 Result := s; 108 108 end; 109 109 end; … … 111 111 procedure TFindFile.FileSearch(const InPath : string); 112 112 var Rec : TSearchRec; 113 Attr : Integer;113 Attr : integer; 114 114 begin 115 115 Attr := 0; … … 125 125 try 126 126 repeat 127 S.Add(inPath + Rec.Name);127 s.Add(inPath + Rec.Name); 128 128 until SysUtils.FindNext(Rec) <> 0; 129 129 finally … … 143 143 SysUtils.FindClose(Rec); 144 144 end; 145 end; 145 end; 146 146 147 147 end. 148
Note:
See TracChangeset
for help on using the changeset viewer.