Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-04

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

14 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bogdan M.Maryniuck
to Marc Weustink: + From: Bogdan M.Maryniuck + + Yes, it's work. Question is HOW. + For example: + + while…

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.

Earlier message 29 lines
----- Original Message ----- From: Marc Weustink To: Sent: 26 ������ 2000 �. 5:47 Subject: RE: [lazarus] Another one bug add: TMemo & TListBox I/O errors? > + From: Bogdan M.Maryniuck > + > + 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 with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Baeseman, Cliff

That is very possible a call to application.processmessages might be a good idea.

The gui may look frozen if you are in some large process without calling it.

Cliff

Earlier message 79 lines
-----Original Message----- From: Bogdan M.Maryniuck Sent: Wednesday, April 26, 2000 6:01 PM To: Subject: Re: [lazarus] Another one bug add: TMemo & TListBox I/O errors? 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 To: Sent: 26 ������ 2000 �. 5:47 Subject: RE: [lazarus] Another one bug add: TMemo & TListBox I/O errors? > + From: Bogdan M.Maryniuck > + > + 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 with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Marc Weustink
to Bogdan M.Maryniuck: ? After *ONE HOUR* to load /var/log/messages into TMemo or TListBox??? Yes, `coz simple…

+ From: Bogdan M.Maryniuck

+ >And finally, try to create a temporary TStringList and then assign to
+ >lines. I think this should be substantially faster (not tested).
+ How really better to do it? (Just code simple).

var
  S: TStringList;
begin
  S := TStringList.Create;
  S.LoadFromFile('your file name here');
  YourListBox.Items.Assign(S);
  S.Free;
end;

+ See, Delphi4 is loading without problems, so I mean that it is just
+ TListBox and TMemo bug or these components is too far from
+ the end for now

It might be an performance issue, the components are way from complete.

Marc

Reply by email

Michal Bukovjan
to Marc Weustink: + From: Bogdan M.Maryniuck + + Yes, it's work. Question is HOW. + For example: + + while…

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 70 lines
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 To: Sent: 26 ŕďđĺ�˙ 2000 ă. 5:47 Subject: RE: [lazarus] Another one bug add: TMemo & TListBox I/O errors? > + From: Bogdan M.Maryniuck > + > + 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 with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Bogdan M.Maryniuck
to Marc Weustink: + From: Bogdan M.Maryniuck + [TMemo errors] TMemo is redisigned recently and far from…

Ok. How about TListBox?

Earlier message 24 lines
----- Original Message ----- From: Marc Weustink To: Sent: 26 ������ 2000 �. 3:07 Subject: RE: [lazarus] Another one bug add: TMemo & TListBox I/O errors? > + From: Bogdan M.Maryniuck > + > [TMemo errors] > > TMemo is redisigned recently and far from complete. So you might run into > problems of things not working. > If you find something and have a solution/fix for it, feel free to mail it > to us. > > Marc > > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Bogdan M.Maryniuck

Oh... Sorry. TMemo have another one bug: nobody can edit it ;)

Regards,
M.B.M
_____________________________________________________

Earlier message 34 lines
----- Original Message ----- From: Bogdan M.Maryniuck To: Sent: 26 ������ 2000 �. 10:46 Subject: TMemo & TListBox I/O errors? Dear all. Here is a real code from Delphi4, which works properly: procedure TForm1.Button1Click(Sender: TObject); var tt:textfile; s:string; begin assignfile(tt,'c:\temp\test.txt'); //very big file reset(tt); while not eof(tt) do begin readln(tt,s); form1.Memo1.Lines.Add(s); form1.ListBox1.Items.Add(s); end; end; On Lazarus this code is NOT working: tt:textfile -- unknown something; form1.memo1.add(s) -- freezing the X-Server (on Linux) form1.ListBox1.Items.Add(s) -- is NOT working at all (or freezing the X-Server). So howto... load a some text from an file to some shild like a simple NOTEPAD? Thanx.

Reply by email

Bogdan M.Maryniuck
to Marc Weustink: + From: Bogdan M.Maryniuck + + Yes, it's work. Question is HOW. + For example: + + while…
Yes, it might be you need to add an Application.ProcessMessages.

? After *ONE HOUR* to load /var/log/messages into TMemo or TListBox???

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)?

Yes, `coz simple *.pas file WITHOUT GUI -- works OK.: I have filtered /var/log/messages into another file I created by same function. A algorythm is working properly OK.

Also, be sure the sorting is off.

What?

And finally, try to create a temporary TStringList and then assign to lines. I think this should be substantially faster (not tested).

How really better to do it? (Just code simple).
See, Delphi4 is loading without problems, so I mean that it is just TLiastBox and TMemo bug or these components is too far from the end for now :-(

Do you use GTK, Qt or Win32?

Linux & GTK.

Reply by email

Baeseman, Cliff

Did you build the glade by chance?

Cliff

Earlier message 48 lines
-----Original Message----- From: Shane Miller Sent: Wednesday, April 26, 2000 1:00 PM To: Subject: RE: [lazarus] Another one bug add: TMemo & TListBox I/O errors? I sent him this code to try. It's pretty simple. The cool thing is I created it using Lazarus IDE and compiled it. A few issues exist (obviously) so the IDE isn't real usable. For example, when I click on a unit, the cursor still doesn't show up until I press a key! Anyway, here's the project for loading a listview. Save these files into lazarus/testproject and run lazarus, PROJECT OPEN the .lpr file. PROJECT BUILD, then run it from a console....it works Shane >>> 04/26/00 11:54AM >>> + From: Bogdan M.Maryniuck + >And finally, try to create a temporary TStringList and then assign to + >lines. I think this should be substantially faster (not tested). + How really better to do it? (Just code simple). var S: TStringList; begin S := TStringList.Create; S.LoadFromFile('your file name here'); YourListBox.Items.Assign(S); S.Free; end; + See, Delphi4 is loading without problems, so I mean that it is just + TListBox and TMemo bug or these components is too far from + the end for now It might be an performance issue, the components are way from complete. Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michal Bukovjan
to Marc Weustink: + From: Bogdan M.Maryniuck + + Yes, it's work. Question is HOW. + For example: + + while…
"Bogdan M.Maryniuck" wrote
> Also, be sure the sorting is off. What?
Be sure that TListBox.Sorted:= false;
How really better to do it? (Just code simple). See, Delphi4 is loading without problems, so I mean that it is just TLiastBox and TMemo bug or these components is too far from the end for now :-(

Yes, it may be bug of these components.

Michal Bukovjan

Reply by email