Board index » delphi » Richedit stops when text >64KB in Delphi 2.0 ?

Richedit stops when text >64KB in Delphi 2.0 ?

Hi !

    I tried to load a textfile >64KB into a Richedit component in
Delphi
2.0. Although I succeeded and the Richedit component displays all the
content of the textfile, I can not change the content from the
keyboard,
because the Richedit component does not accept any other keypress than
DEL.
At the same time when the size of the textfile loaded in Richedit is
<64KB
then I can edit the content of Richedit without problems. I thought
there
are no 64KB limitations in Delphi 2.0. Is this false or am I doing
something
wrong here ?

I would appreciate any comments on the possible solution of this
problem,
Thank you in advance,

Zoli

(s...@mail.netx.hu)

 

Re:Richedit stops when text >64KB in Delphi 2.0 ?


Zoli:

Try setting the MaxLength property of the RichEdit to some high number
(2147483647).

--
Regards
Ralph (TeamB)
Herrsching, Germany
(TeamB cannot respond to questions received via email)

Quote
Zoli wrote in message <6rsbpi$f...@forums.borland.com>...

|    I tried to load a textfile >64KB into a Richedit component in
|Delphi
|2.0. Although I succeeded and the Richedit component displays all the
|content of the textfile, I can not change the content from the
|keyboard,
|<deletia>
|I would appreciate any comments on the possible solution of this
|problem,

Re:Richedit stops when text >64KB in Delphi 2.0 ?


Quote
Ralph Friedman (TeamB) wrote: <6rtnd2$ft...@forums.borland.com>...
>Try setting the MaxLength property of the RichEdit to some high
number
>(2147483647).

Thank you Ralph for the suggestion, I did, but unfortunately it didn't
help. But I found out that I can change the content even of a textfile
Quote
>64KB, but I can not make it > bigger <.

This means, that whenever I load a textfile (which is above 64K) into
RichEdit  then by editing from the keyboard first I can use only the
DEL and the BACK SPACE buttons to delete some part of the text. Then I
can edit the text just as usual, I can type in everything from the
keyboard, but maximum as many characters can be added, as many were
deleted before via the DEL or BACKSPACE buttons. That is, I can not
make the file bigger. This is worrying particularly because I can not
even add a simple empty line via ENTER to the TEXT file.
This error occurs even in the most simple program containing only one
form with one richedit component. The textfile which I tried to load
and edit and make bigger has an initial size of 66856 bytes.

Any ideas why this might happen, and how to fix ?

Zoli

Re:Richedit stops when text >64KB in Delphi 2.0 ?


Zoli,

i think you have run against a D2-specific bug, it uses the wrong message
to implement the MaxLength property for a rich edit control. Try

  richedit1.perform( em_exlimittext, 0, $7fffffff );

perhaps that gets you going.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitely requested!

Re:Richedit stops when text >64KB in Delphi 2.0 ?


Dear Peter,
    Thank you for the suggestion, I tried.
I said:
procedure TForm1.Button1Click(Sender: TObject);
begin
  With Richedit1 do
   begin
     lines.loadfromfile('D:\A.DAT');
     perform(em_exlimittext, 0, $7fffffff );
   end;
end;
Delphi2 said:
Undeclared identifier: 'em-exlimittext'
Is there a need for a special unit to use for this message to get
declared ?
Thanks for your help again,
Zoli

Re:Richedit stops when text >64KB in Delphi 2.0 ?


Zoli:

Include "richedit" in your uses clause.
--
Regards
Ralph (TeamB)
Herrsching, Germany
(TeamB cannot respond to questions received via email)

Quote
Zoli wrote in message <6s35sd$m...@forums.borland.com>...

<deletia>
|Delphi2 said:
|Undeclared identifier: 'em-exlimittext'
|Is there a need for a special unit to use for this message to get
|declared ?

Re:Richedit stops when text >64KB in Delphi 2.0 ?


Ralph Friedman (TeamB) rta a k?vetkez? zenetben:
<6s381p$mh...@forums.borland.com>...

Quote
>Include "richedit" in your uses clause.

Dear Ralph,

Thank you for your response. It worked this time !
Not with $7fffffff  however, but with a smaller number like 100000.

Thank you for your help !

Best regards,

Zoli

Other Threads