全部文本 #18841 原始 编辑

Mine

公开 text v1 · 不可变
·已发布 2005-07-30 09:17 UTC
渲染后的文本正文
a form, memo, 3 buttons

button1 is save, button 2 is load, button 3 add lines to memo

procedure TForm1.Button1Click(Sender: TObject);
begin
  savedialog1.Execute;
  if savedialog1.FileName <> '' then
  memo1.Lines.SaveToFile(savedialog1.FileName); 
end;

procedure TForm1.Button3Click(Sender: TObject);
var x:integer;
begin
inc(x);
memo1.Lines.Add(inttostr(x));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  opendialog1.Execute;
  if opendialog1.FileName <> '' then
  begin
    memo1.lines.Clear;
    memo1.Lines.LoadFromFile(opendialog1.FileName);
  end;
end;