unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, Buttons;
type
TForm1 = class(TForm)
Button1: TButton;
StringGrid1: TStringGrid;
BitBtn1: TBitBtn;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i:byte;
name,zhanr,raz:string;
f:textfile;
begin
assignfile(f,'love.txt');
{rewrite(f);}
i:=0;
reset(f);
while not EOF(f) do //думаю здесь запара
begin
inc(i);
reset(f);
readln(f, name);
StringGrid1.Cells[0,i]:=name;
readln(f, zhanr);
StringGrid1.Cells[1,i]:=zhanr;
readln(f, raz);
StringGrid1.Cells[2,i]:=raz;
end;
closefile(f);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
with StringGrid1 do
begin
Cells[0,0]:='Íàçâàíèå';
Cells[1,0]:='Æàíð';
Cells[2,0]:='Ðàçìåð';
end;
end;
end.
Сообщение отредактировано: nblazhko -