symbols: TLabel;
spaces: TLabel;
lines: TLabel;
Button1: TButton;
Edit1: TEdit;
Button2: TButton;
Open1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ButtonlClick(Sender: TObject); begin
//начинаем обзор с текущей папки
Open1.InitialDir:= GetCurrentDir;
if Open1.Execute // открываем диалоговое окно выбора файла
then Edit1.Text:= Open1.FileName
else ShowMessage('Файл не выбран!');
end;
procedure TForm1.Button2Click(Sender: TObject);
var
f: file of byte; //Переменная для работы с файлом
str: byte; //Содержит считанный байт
oldstr, symbol, word, line, space: Integer;
begin