Discussion:
Problem of syncronize
(too old to reply)
Cooper
2010-03-27 22:14:15 UTC
Permalink
Hello, i have this code:

StatusBar1.Caption := 'Loading...';
ProgressBar1.Position := 50;
// Some operation
Sleep (1000);
ProgressBar1.Position := 100;
StatusBar1.Caption := 'Completed.';

My problem is that all this operation not are syncronized. In sense i want
that this are executed only after that it ended.
At moment, effect is that i display "completed" before that progress bar has
terminated; as i can solve this problem?
Thanks very much.
Cooper.

PS: I have tried too using time for lag, but same effect :(
Jamie
2010-03-27 23:41:14 UTC
Permalink
Post by Cooper
StatusBar1.Caption := 'Loading...';
ProgressBar1.Position := 50;
// Some operation
Sleep (1000);
ProgressBar1.Position := 100;
StatusBar1.Caption := 'Completed.';
My problem is that all this operation not are syncronized. In sense i
want that this are executed only after that it ended.
At moment, effect is that i display "completed" before that progress bar
has terminated; as i can solve this problem?
Thanks very much.
Cooper.
PS: I have tried too using time for lag, but same effect :(
ProgressBar1.Repaint ?
Cooper
2010-03-28 08:40:17 UTC
Permalink
Post by Jamie
ProgressBar1.Repaint ?
Nothing :( i display every "Completed" and not "Loading..." during the
process and progressbar that update :(
In order i want this effect:

1) Update StatusBar;
2) Do Something (ad update ProgressBar)
// when finish to do something (not before)
3) Update StatusBar;

In other words, step3 only when step2 is terminated not before.
Thanks again very much.

Loading...