JG> I have a program with a loop inside. Within that loop each record in
JG> a TTableis checked. During that loop I show the progress via the
JG> TGauge component.
JG> During that loop the whole system stops. How do I release a timeslice
JG> so that any other programs can continue?
JG> Now it's even imposible to provide an Abort button.
JG> Form2.Gauge1.MinValue := 0;
JG> Form2.Gauge1.MaxValue := Table1.RecordCount;
JG> { Form2.fsStyle := sfStayOnTop }
JG> Form2.Show;
JG> Table1.First;
JG> while not Table1.EOF do
JG> begin
JG> if Table1.FieldByName( 'FIELD1' ).AsString = 'gotcha' then
JG> begin
JG> dosomething;
JG> end;
JG> Form2.Gauge1.AddProgress( 1 );
JG> { release timeslice }
JG> Table1.Next; { forget this one and Win95/3.1 will crash terrible
JG> !! }end;
JG> Form2.Close;
JG> Toedeloe,
Try putting the following line in your loop:
Application.ProcessMessages;
Hope that helps.
Steve
--- FreeMail 1.07b
(1:203/21)
---------------
* Origin: The Visual Programmer's Workshop - N.H., Ca (916)338-3230 *
|