Board index » delphi » Updataing variables in a database loop

Updataing variables in a database loop

I am having problems uddating counter variables inside of a database
loop.

eg:
a:=0;
while not file.eof do
begin
inc(a);
edit1.text:=strtoint(a);
file.next;
end;

With this loop the text in edit1 is not updated till the loop finishes,
if I put the same code in a loop without  a database all works fine. How
can I update screen controls when databases are being used.

Dave

 

Re:Updataing variables in a database loop


Dave Walton <prsbj...@prestel.co.uk> wrote in article
<3282A979.1...@prestel.co.uk>...

Quote
> I am having problems uddating counter variables inside of a database
> loop.

> eg:
> a:=0;
> while not file.eof do
> begin
> inc(a);
> edit1.text:=strtoint(a);

Application.ProcessMessages;

Quote
> file.next;
> end;

HTH
Peter

Re:Updataing variables in a database loop


Quote
Dave Walton <prsbj...@prestel.co.uk> wrote:
>I am having problems uddating counter variables inside of a database
>loop.

>eg:
>a:=0;
>while not file.eof do
>begin
>inc(a);
>edit1.text:=strtoint(a);

You could try Edit1.Refresh; here. If that isn't sufficient maybe adding
Application.ProcessMessages; would allow it to  work.

Quote
>file.next;
>end;

>Dave

HTH

Ray Cramer
R...@Pol.ac.uk

Other Threads