?
Solved

how to write memo to textfile

Posted on 1998-06-16
3
Medium Priority
?
284 Views
Last Modified: 2010-04-04
how do i get the text i have in my Tmemo written to a textfile?
0
Comment
Question by:tomas11
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
brainware earned 400 total points
ID: 1353316
// Use this on a Button or somthing..
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
 F : TextFile;
 I : Integer;
begin
 AssignFile(f,'mytext.txt');  // Assigns mytext to F as the Textfile
  rewrite(f); // Rewrites, Kills the File you selected
   for I:=0 to Memo1.Lines.Count do // Loops from 0 to count of lines in memo
    writeLn(f,Memo1.Lines.Strings[I]);
  CloseFile(f); // Closing the file.. Always REMEMBER this..
end;

0
 
LVL 3

Expert Comment

by:vladika
ID: 1353317
Use this

Memo.Lines.SaveToFile('mytext.txt');




0
 
LVL 3

Expert Comment

by:vladika
ID: 1353318
2brainware:

for I:=0 to Memo1.Lines.Count - 1 do // Loops from 0 to count of lines in memo
                                   ^^^^^^^^^^^

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question