?
Solved

Copy text from memo into text file

Posted on 2004-04-28
3
Medium Priority
?
450 Views
Last Modified: 2011-09-20
How to copy out all the text from a memo into a text file?
0
Comment
Question by:cybermilky
[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
3 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 10946441
memo1.lines.savetofile('YourFileNameHere.txt');
0
 
LVL 3

Expert Comment

by:MikProg
ID: 10946764
Memo1.Lines.SaveToFile( ... );
0
 

Expert Comment

by:meadorj
ID: 10949908
The easy way is to do:
  memo1.lines.savetofile('YourFileNameHere.txt');
If you want to do it the hard way you would have to do;
procedure Write;
var
  F1 : TextFile;
  i : Integer;
const
  FILENAME : string = 'C:\somefile.txt';
begin
  AssignFile(F1,FILENAME);
  Rewrite(F1);
  for i := 0 to memo1.lines.count-2 do begin
    writeLn(F1,memo1.lines.strings[i]);
  end;
  write(F1,memo1.lines.strings[i]);
  CloseFile(F1);
end;

And you just call this procedure when you need to write the text to a file.  I would use the easy way unless you are saving any header or footer information.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month9 days, 5 hours left to enroll

764 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