Board index » delphi » Save Edit Text to txt.file?

Save Edit Text to txt.file?

In article <88c2el$fi...@news.rhein-zeitung.DE>, "Carsten Singer"

Quote
<csin...@mainz-online.de> writes:
>I need a way (or an command) to save an edit text in an txt file.
>Can anybody help me?

Your easiest option is to use a TMemo but prevent it having more than one line,
and then use its own file saving methods -
MyMemo.Lines.SaveToFile('MyFile.txt') and
MyMemo.Lines.LoadFromFile('MyFile.txt').

Prevent it from having more than one line by :-

Setting WordWrap false, removing the design-time lines ("Memo1" & CR), setting
Height to 13 (same as a TEdit).

But you'd be better off learning how to write text to, and read text from a
file, but that's a little more complex.

Alan Lloyd
alangll...@aol.com

 

Re:Save Edit Text to txt.file?


Look in the help for AssignFile. It's the old way, but it still works.

Tony

Quote
Carsten Singer wrote in message <88c2el$fi...@news.rhein-zeitung.DE>...
>I need a way (or an command) to save an edit text in an txt file.
>Can anybody help me?

>Shadow

Other Threads