Информатика. Программирование в Delphi
          
        
        
          
            305
          
        
        
          9. Окончательный вариант приложения приведен в листинге 25.1. Ком-
        
        
          ментарии удалены.
        
        
          
            Листинг 25.1
          
        
        
          unit Unit1;
        
        
          interface
        
        
          uses
        
        
          Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dia-
        
        
          logs, StdCtrls, ExtCtrls, FileCtrl;
        
        
          type
        
        
          TForm1 = class(TForm)
        
        
          LabeledEdit1: TLabeledEdit;
        
        
          LabeledEdit2: TLabeledEdit;
        
        
          Button1: TButton;
        
        
          Button2: TButton;
        
        
          Memo1: TMemo;
        
        
          Label1: TLabel;
        
        
          procedure Button1Click(Sender: TObject);
        
        
          procedure FormCreate(Sender: TObject);
        
        
          procedure Button2Click(Sender: TObject);
        
        
          private
        
        
          { Private declarations }
        
        
          public
        
        
          { Public declarations }
        
        
          end;
        
        
          
            procedure find(dir,tp:string;var filelist:TStringList;var count:integer);
          
        
        
          var
        
        
          Form1: TForm1;
        
        
          implementation
        
        
          {$R *.dfm}
        
        
          
            procedure find(dir,tp:string;var filelist:TStringList;var count:integer);
          
        
        
          var
        
        
          searchrec:TSearchRec;
        
        
          begin
        
        
          if DirectoryExists(dir) then
        
        
          begin
        
        
          SetCurrentDir(dir);
        
        
          if dir[length(dir)]<>'\' then