Solved

Component TMEMO: how can I add Lines

Posted on 1998-09-01
5
147 Views
Last Modified: 2010-05-18
In my program I have to read a file and fill the lines into the MEMO. But it shows only the first row.
How can I add lines (at runtime).

Thank you!
0
Comment
Question by:zulliger
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1338335
Hi

If it's a text file, you should be able to do:
    MyMemo.Lines.LoadFromFile('C:\SomePath\SomeFile.txt');

JB
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 1338336
Hi zulliger,

Every lines of memo are stored in Lines property :

* to put full file in memo :

begin
  Memo1.Lines.LoadFromFile('C:\AUTOEXEC.BAT');
  Writeln('The 6th line of AUTOEXEC.BAT is: ', Memo1.Lines[5]);
end;

* to put line in memo :

  Memo1.lines.Add('This is a new line');

Regards, Zif.
0
 

Author Comment

by:zulliger
ID: 1338337
Thank you very much!
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1338338
oops, JimBob, ... Looks like you've gave -a comment while I was answering it... Sorry didn't saw your comment, really!
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1338339
No problem Zif.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 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