Solved

TMemo and cxMemo, line limit?

Posted on 2003-11-06
4
857 Views
Last Modified: 2007-12-19
Hi Experts, I have no idea whats causing this. I have tried both a TMemo component and cxMemo component with the same results. I have the following code:

memCustDetails: TMemo;
.
.
.

memCustDetails.Lines[0] := frmCustomerLookup.FName + ' ' + frmCustomerLookup.Surname;
memCustDetails.Lines[1] := frmCustomerLookup.Address;
memCustDetails.Lines[2] := 'test';
memCustDetails.Lines[3] := 'test2';

After successfully entering the first two lines, the memo never shows the 3rd line or line[2]. 'test' is never displayed. It would appear that any line after the second or line[1] is never displayed. Is there a limit on the number of lines?

Thanks in advance

Ian
0
Comment
Question by:beavei
4 Comments
 
LVL 3

Accepted Solution

by:
ThoseBug earned 75 total points
ID: 9695440
the problem is when you use lines[x] only.. may be in the line [2] or [3] don't have any valid char...the consequence is this line not exits...you can use this..

memo1.Lines.Insert(0,'test');
memo1.Lines.Insert(1,'test');
memo1.Lines.Insert(2,'test');
memo1.Lines.Insert(3,'test');

Regards.
0
 
LVL 6

Expert Comment

by:swift99
ID: 9699190
Tmemo has a line limit that is fairly small (or possibly a buffer size limit).

TRichText (or is it TRichMemo?) has a much higher limit.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9699606
it is TRichEdit, swift99

TMemo-limit default -> 32KB, max 64KB
TRichedit-limit default -> 64KB max 2GB

(XP, win2000 have a bit higher default limits)

but the problem is worked out by ThoseBug already

meikl ;-)
0
 

Author Comment

by:beavei
ID: 9705842
Thanks ThoseBug it works a treat. Very strange how the 'memo.lines[x] := value' doesn't go past 2 though...

Thanks again
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
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…

707 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

12 Experts available now in Live!

Get 1:1 Help Now