[lazarus] Speaking of TMemo and RH9...

Marc Weustink marc at dommelstein.net
Thu Apr 17 18:21:28 EDT 2003


At 23:42 17-4-2003 +0200, Michael.VanCanneyt at Wisa.be wrote:

>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.

A while ago it was discussed, and the TStrings in TMemo will be replaced by 
a Text based TStrings. If it is OK, someone is working on that.

Marc






More information about the Lazarus mailing list