Solved

All Memo Text in one Line

Posted on 2003-11-08
4
215 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

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

Suggested Solutions

Title # Comments Views Activity
calling Tcolordialog in dll make the form disappear 8 111
Delphi: Connect to running MS Outlook 4 77
Base1 Encode/Decode 3 77
How to build JSON File in Delphi 6 3 32
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…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

813 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

15 Experts available now in Live!

Get 1:1 Help Now