BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Pausing a program for 5 seconds or more...

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Colin B Maharaj
Guest





PostPosted: Sun Mar 13, 2005 12:58 pm    Post subject: Re: Pausing a program for 5 seconds or more... Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.