[lazarus] Speaking of TMemo and RH9...

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Thu Apr 17 17:18:38 EDT 2003




On 17 Apr 2003, Tom Lisjac wrote:

>
> > > It works... but I can't help but wonder if there's a more elegant way to
> > > make TMemo go? :)
> >
> > The TTextString (or whatever is used) implementation of TMemo.Lines
> > should respect the beginupdate/endupdate calls: Changes should not
> > be applied till the updatecount reaches zero again.
>
> Thanks for the reply!
>
> The following provides exactly the same slow load (50+ seconds)...so I
> wondered if beginupdate and endupdate had been implemented in TMemo:
>
[...]
> The workaround is perfectly acceptable... but the behavior of the lines
> property seemed a little odd so I thought I'd mention it.

I have checked the TMemoStrings stuff.
What can I say ?

I think that whoever wrote it should rethink his design.
Filling up a memo with a lot of lines will become slower
with a factor N^2 the way it is done now:

This code
    TempStrings := TStringList.Create;
    CurText := FMemo.Text;
    TempStrings.Text := CurText;
    Cnt:=TempStrings.Count;

Is executed once per line added. This is not acceptable in my opinion,
as the statement
  TempStrings.Text := CurText;
is repeating the operation that is actually being performed.

Michael.






More information about the Lazarus mailing list