dynadec.com

dynadec user support forums
It is currently Wed Sep 08, 2010 4:25 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: wait for keyboard input
PostPosted: Wed Mar 10, 2010 10:33 am 
Offline

Joined: Mon Feb 15, 2010 5:53 am
Posts: 13
Hi,

Is there a simple way to get Comet to pause execution, until e.g. any key is pressed i.e.

...
cout << "press any key" << endl;
waitForKeypress();
...

- may look primitive, but it came to be my preferred ad hoc debugging method i.e. "print me exactly what I want to know, give me a chance to read it, carry on".

thanks,

jon


Top
 Profile E-mail  
 
 Post subject: Re: wait for keyboard input
PostPosted: Wed Mar 10, 2010 10:49 am 
Offline

Joined: Tue Nov 18, 2008 12:13 pm
Posts: 68
I usually do this:

Code:
cin.getInt();


That blocks the input until I type a number (e.g., "1").

If i type a string (e.g., "a") it will no stop at any subsequent calls to getInt(), returning 0 in each.

_________________
Laurent


Top
 Profile E-mail  
 
 Post subject: Re: wait for keyboard input
PostPosted: Wed Mar 10, 2010 11:00 am 
Offline

Joined: Mon Feb 15, 2010 5:53 am
Posts: 13
thanks, that makes me happy

jon


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group