unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Timer1: TTimer;
Edit1: TEdit;
procedure Timer1Timer(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
f:textfile;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Timer1Timer(Sender: TObject);
var temp:string;
begin
if not eof(f) then
begin
readln(f,temp);
edit1.text:=temp;
end
else
timer1.Enabled:=false;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
assignfile(f,'c:/aa.txt');
reset(f);
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
closefile(f);
end;
end.