Solved

All Memo Text in one Line

Posted on 2003-11-08
4
207 Views
Last Modified: 2010-04-05
Hi.
I have a memo with some lines , like this :

Name : Richard Jakson
Age : 35
Adress : 5th Avenue

and i want like this

Name : Richard Jakson Age : 35 Adress : 5th Avenue

can someone help me ??? thnx a lot
0
Comment
Question by:fuscao_sp
4 Comments
 
LVL 5

Expert Comment

by:arjanh
ID: 9706982
var
  res : String;
  i : Integer;
begin
  res := '';
  for i := 0 to memo.lines.count - 1 do
    res := res + memo.lines[i];
end;
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 45 total points
ID: 9707038
or

procedure TForm1.Button1Click(Sender: TObject);
begin
  memo1.Text := stringReplace(memo1.text,#13#10,' ',[rfReplaceAll]);
end;

meikl ;-)
0
 
LVL 1

Expert Comment

by:JackNaif
ID: 9707262
Both those solutions will most likely work.
Both will alter the contents of your memo to be in one line.

But if memo1.wordwrap is true, you will see it on screen as many lines unless your memo1.width is big enough to fit the whole lenght of the text. If you set it to false, then the text will go beyond the edge and you will have to scroll.

However if you want to process the text in your memo  as a single line while showing it on the screen as many lines, then you should make use of memo1.text. It has all the text in one single string. It's good for many applications such as storing it in a file where you already have other contents. (If you want to put only the contents of a single TMemo in a file, you use memo1.lines.SaveToFile, and then memo1.lines.LoadFromFile to get it back).

Hope it helps:

Jack
0
 
LVL 5

Expert Comment

by:DeerBear
ID: 9714284
Hi,

Use Memo1.Lines.Text .

Cheers,

Andrew
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now