unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
EdtStub: TEdit;
BtnStub: TButton;
RichEdit1: TRichEdit;
Button1: TButton;
opn: TOpenDialog;
SaveDialog1: TSaveDialog;
Memo1: TMemo;
Timer1: TTimer;
procedure BtnStubClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
x : integer;
z : integer;
insert :
string;
implementation
{$R *.dfm}
procedure TForm1.BtnStubClick(Sender: TObject);
begin
opn.FilterIndex := 1;
IF opn.execute
THEN begin
EdtStub.Text := opn.FileName;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
RichEdit1.Lines.LoadFromFile(opn.FileName);
z := 50;
x := 0;
Timer1.Enabled := true;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Repeat
insert := RichEdit1.Lines.Strings[x];
memo1.Lines.Add(insert);
x := x +1;
Until x = z;
Timer1.Enabled := false;
if x = z
then
begin
SaveDialog1.Execute;
memo1.Lines.SaveToFile(SaveDialog1.FileName);
x := x + 50;
z := z + 50;
memo1.clear;
Timer1.Enabled := true;
end;
end;
end.