0

i have 4 memos on a page 3 of them are single line and the last is a large memo.

Memo1 Memo2 Memo3 and Memo4

now for memo 4 i can use

Memo4.Lines.SaveToFile
    (SaveDialog1.FileName + '.txt');

that works perfectly, but i want Memo1 2 and 3 saved to the same text file.

how is this possible?

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by lad389
0

I created a form ,and put 5 memos as memo1,memo2,memo3,memo4,memo5.And put a button too as button1.
I copied the 4 memos contents to the 5th and saved the 5th memo5 contents is saved to a txt file.
I selected and set the memo5 in the Object Inspector visible := FALSE,so cannot see,but it is exists and you know that :D
and then programed the button1 as

procedure TForm1.Button1Click(Sender: TObject);
begin
   memo5.Lines.Clear;//first clear the contents of the memo5
   memo5.Lines.AddStrings(memo1.lines);
   memo5.Lines.AddStrings(memo2.lines);
   memo5.Lines.AddStrings(memo3.lines);
   memo5.Lines.AddStrings(memo4.lines);
   memo5.Lines.SaveToFile('C:\myfile.txt');
end;

I saved to the c:\myfile.txt :) but rewrite to yours :D

0

memo5.Lines.Clear;//first clear the contents of the memo5
memo5.Lines.AddStrings(memo1.lines);
memo5.Lines.AddStrings(memo2.lines);
memo5.Lines.AddStrings(memo3.lines);
memo5.Lines.AddStrings(memo4.lines);
memo5.Lines.SaveToFile(SaveDialog2.FileName + '.txt');

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.