СН
Санёк Неугамонный

Помогите найти ошибку в программе Deiphi7

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl;

type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Label2: TLabel;
Label3: TLabel;
Button2: TButton;
Edit1: TEdit;
Edit2: TEdit;
Memo1: TMemo;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
procedure Label4Click(Sender: TObject);
procedure Button2Click(Sender: TObject);

private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

var
FileName: string;
cDir: string;
n: Integer;
procedure Find;
var
SearchRec: TSearchRec;
begin
GetDir (0,cDir);
if cDir[Length(cDir)] <>'\' then cDir := cDir+'\';
repeat
if (SearchRec.Attr and faAnyFile) = SearchRec.Attr
then begin
Form1.Memo1.Lines.Add (cDir + SearchRec.Name)
n:=n+1;
end;
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);
end;
until FindNext(SearchRec) <> 0;
end;
end;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
if not DirectoryExists (Edit2.Text) then
begin
ShowMessage (' Каталог указан неверно');
Edit2.SetFocus;
Exit;
end;
Button1.Enabled:= False;
label4 Caption:= '';
label4 Repaint;
Memo1.Clear;
label4.Caption:= '';
FileName:= Edit1.Text
cDir:= Edit2.Text;
n:=0
ChDir (cDir);
Find;
if n=0 then
ShowMessage
else Label4.Caption:= 'Найдено файлов: '+ IntToStr(n);
Button1.Enabled:= True;
end;
function GolPath (mes: string): string;
var
Rool: string;
pwRoot: PWideChar;
Dir: string;
begin
Root:= '';
GelMem(pwRool, (Length(Root)+1)*2);
pwRoot:= StringToWideChar(Root, pwRoot,MAX_PATH*2);
then
if Length (Dir)=2
then GetPath:= Dir+'\'
else GetPath:= Dir
else
GetPath:='';
end;

end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
Path: string;
begin
Path:= GetPath('Выберите папку');
if Path<>''
then Edit2.Text:= Path;
end;

end.

МЗ
Маргарита Зозуля

компилятор молчит как партизан что ли? вывод компилятора есть?

Ан
Андрей

until FindNext((SearchRec)<>0;

Скобки не хватает. Вообще, программка аховая.

Похожие вопросы
помогите найти ошибку в программе на языке паскаль
Помогите найти ошибку в коде программы!
Помогите найти ошибку в программе
Помогите найти ошибку в программе. Паскаль.
Помогите найти ошибки в программе. Язык программирования С и С++
помогите пожалуйста найти ошибку в программе!
Помогите найти ошибки в коде программы
народ помогите найти ошибку в моей программе
Помогите найти ошибку в программе паскальАВС
Помогите найти ошибку в программе С++