Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TMemo and TStringList limits

Posted on 2001-08-24
6
Medium Priority
?
1,743 Views
Last Modified: 2012-08-14
I tried to load a HTML file into a TMemo and also into a TStringList.  The HTML file was 43kb.  When I loaded the fil into the TMemo, only about half the file was loaded and visible in the TMemo.  When I loaded the file into a TStringList via LoadFromFile() I again was missing a sizeable portion of the file.  When I analyzed the Capacity and Count properties after TStringList.LoadFromFile I had a Capacity of 288 and a Count of 200.  And yet approx. 30% of the file was missing from the StringList.

Can anyone explain why this happens?
0
Comment
Question by:Monroe406
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 5

Expert Comment

by:scrapdog
ID: 6424007
Did you write to the Capacity property at all?
0
 

Author Comment

by:Monroe406
ID: 6424029
>> Did you write to the Capacity property at all?

Nope.  Prior to the LoadFromFile the Capacity and Count were at 0.  After the LoadFromFile they were 288 and 200 respectively.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 6424040
This is probably something that would be easier to diagnose if I were to do it myself.  If you want, mail the HTML file to scrapdog@jvlnet.com, and I'll have a look.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 6424466
per default depending on the os the limit is 32K,

you can extend the limit of the memo up to 64K
using the EX_LIMITTEXT Message before loading

for larger files use a TRichedit, there the limit is default set to 64K,
but can extended up to 2GB

a sample follows

meikl ;-)
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 6424495
sorry i meant the message EM_EXLIMITTEXT

a sample with a trichedit

procedure TForm1.Button1Click(Sender: TObject);
begin
  Richedit1.Perform(EM_EXLIMITTEXT,0,$FFFFF);  //1 MB
  if Opendialog1.Execute then
    Richedit1.Lines.LoadFromFile(Opendialog1.FileName);
  RichEdit1.SelStart := Length(RichEdit1.Text);
  Richedit1.SetFocus;
end;

you must add the richedit-unit in the uses-clause
(there is this message-constant declared)

meikl
0
 
LVL 6

Expert Comment

by:edey
ID: 6425056
meikl beat me to it, so I'll have to sugest another alternative. Try this snippet in a project with a TWebBrowser, a TEdit & a TButton:

procedure TForm1.Button1Click(Sender: TObject);
var
   doc : variant;
begin
     webBrowser1.navigate(edit1.text);
     while webBrowser1.Busy do
           application.ProcessMessages;
     doc := webBrowser1.Document;
     doc.body.innerText := doc.body.innerHTML;
end;

GL
Mike
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

722 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