[lazarus] Another one bug add: TMemo & TListBox I/O errors?

Michal Bukovjan m_bukovjan at advisbbdo.cz
Wed Apr 26 10:25:44 EDT 2000


Yes, it might be you need to add an Application.ProcessMessages.
However, it should not be that thw whole application just freezes.
Do you actually reach the end of the file (i.e. the bug may be in the Eof
function)?
If the file is really large, it may take some time to add all the lines to
a list box.
Also, be sure the sorting is off.
And finally, try to create a temporary TStringList and then assign to
lines. I think this should be substantially faster (not tested).

Do you use GTK, Qt or Win32?

Michal Bukovjan

"Bogdan M.Maryniuck" wrote:

> Ok, Marc.
> Here is detailed answer:
>
> begin
>    readln(sometextfile,somestring);
>    listbox.items.add(somestring);
> end;
>
> Here is all Ok -- I see my line there.
>
> When I try to (just for fun):
> begin
>    readln(sometextfile,somestring);
>    listbox.items.add(somestring);
>    readln(sometextfile,somestring);
>    listbox.items.add(somestring);
>    readln(sometextfile,somestring);
>    listbox.items.add(somestring);
>    readln(sometextfile,somestring);
>    listbox.items.add(somestring);
>    readln(sometextfile,somestring);
>    listbox.items.add(somestring);
> end;
>
> All RIGHT. And all OK.
>
> But:
> while not eof(sometextfile) do
> begin
>    readln(sometextfile,somestring);
>    listbox.items.add(somestring);
> end;
>
> It's freezing a system. Do I need to add:
> application.processmessages
> into the LOOP? Or what?.. Please help.
>
> ----- Original Message -----
> From: Marc Weustink <Marc.Weustink at cuperus.nl>
> To: <lazarus at miraclec.com>
> Sent: 26 &racute;&dcaron;&dstrok;&lacute;ë&dot; 2000 &abreve;. 5:47
> Subject: RE: [lazarus] Another one bug add: TMemo & TListBox I/O errors?
>
> > + From: Bogdan M.Maryniuck [mailto:mbm at diprintas.lt]
> > +
> > + Yes, it's work. Question is HOW.
> > + For example:
> > +
> > + while not eof(sometextfile) do
> > +    begin
> > +       readln(sometextfile,someasciistring);
> > +       listbox.items.add(someasciistring);
> > +    end;
> > +
> > + ...hanging a system and _NOT_ load a lines into a listbox. :-(
> >
> > How many lines are you trying to add? Have you tried one ?
> >
> > Marc
> >
> >
> > _________________________________________________________________
> >      To unsubscribe: mail lazarus-request at miraclec.com with
> >                 "unsubscribe" as the Subject
> >     archives at http://www.miraclec.com/list_archives/lazarus
>
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>     archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list