 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Colin B Maharaj Guest
|
Posted: Sun Mar 13, 2005 12:58 pm Post subject: Re: Pausing a program for 5 seconds or more... |
|
|
You've got this all wrong. Looping and pausing is not the same thing.
You can loop with a pause 'n' times and thus create a pause = pause x
'n' times. There is not timing in a loop.
Use something like Sleep to do this. Here is the help text.
--------------------------------------------------------------
The Sleep function suspends the execution of the current thread for a
specified interval.
VOID Sleep(
DWORD dwMilliseconds // sleep time in milliseconds
);
--------------------------------------------------------------
If you want to see the screen update, you can do a sleep in a loop like
this....
for (int i=0; i<50; i++)
{
Sleep(100);
Application->ProcessMessages();
}
Jean Boivin wrote:
| Quote: | Hello,
This is a quick question.
I want to pause a program for about 5 seconds and be able to show a message
in the Status bar of my application.
I used to do this :
for(i = 0; i<10000000;)
{
//Just as loop
i++;
}
For some reason, this is not working even if I put the counter to
10000000...(C++ Builder 6.0 is too fast...)
Do you have any idea how to pause a program to show a message.
Thanks for your help.
Jean Boivin
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|