Form Project - Memos to File and Append - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Form Project - Memos to File and Append

garden4orkgarden4ork Posts: 1Member
I'm sure this is very simple and I'm missing a trick or something, but all I want to do is write something in a memo, click a button and save what is there to a text file and then be able to change the memo, click the button again and add what has been changed onto the text file (like an append)

Just so you know, might get quite a few more questions thrown this way over the next few days/weeks

Any help appreciated, thanks. Hopefully I didn't break any forum rules

Comments

  • Crono84Crono84 Posts: 6Member
    [code]
    procedure TForm1.Button2Click(Sender: TObject);
    var
    MF: textfile;
    ctr:integer;
    begin
    assignfile(MF,'file.txt');
    append(MF);
    for ctr:=0 to memo1.Lines.Count do
    writeln(MF,memo1.Lines.Strings[ctr]);

    closefile(MF);
    end;
    [/code]
Sign In or Register to comment.