Информатика. Программирование в Delphi
306
dir:=dir+'\';
if FindFirst(tp,faAnyFile,searchrec)=0 then
repeat
filelist.Add(Dir+searchrec.Name);
inc(count);
until FindNext(searchrec)<>0;
if FindFirst('*',faAnyFile,searchrec)=0 then
repeat
if searchrec.Attr and faDirectory=faDirectory then
if searchrec.Name[1]<>'.' then
begin
ChDir(searchrec.Name);
find(GetCurrentDir,tp,filelist,count);
ChDir('..');
end;
until FindNext(searchrec)<>0;
end
else
begin
filelist.Add('Каталог не найден...');
count:=0;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.BorderStyle:=bsDialog;
LabeledEdit1.Text:='c:\';
LabeledEdit2.Text:='*.jpg';
Memo1.ScrollBars:=ssBoth;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
dir:string;
begin
if SelectDirectory('Выберите каталог для поиска','',dir) then
if dir<>'' then
LabeledEdit1.Text:=dir;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
filelist:TStringList;