• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Component TMEMO: how can I add Lines

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
zulliger
Asked:
zulliger
  • 2
  • 2
1 Solution
 
JimBob091197Commented:
Hi

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

JB
0
 
ZifNabCommented:
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
 
zulligerAuthor Commented:
Thank you very much!
0
 
ZifNabCommented:
oops, JimBob, ... Looks like you've gave -a comment while I was answering it... Sorry didn't saw your comment, really!
0
 
JimBob091197Commented:
No problem Zif.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now