944,198 Members | Top Members by Rank

Ad:
Sep 10th, 2007
0

how to have the code pause and then continue with a key stroke

Expand Post »
I have written my code in VB6.
I would like the code to pause when variable x = 1, and the program will continue when I hit a key or something of that sort.
Could you give me a hand on this?
ThanX
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nanoscientist is offline Offline
4 posts
since Sep 2007
Sep 10th, 2007
0

Re: how to have the code pause and then continue with a key stroke

There are different ways to approach this based on your actuall requirement.

-- You can use a timer and make the timer active when x=1 and inactive when its not.

-- else you can use the sleep and then resume when the value of x changes.

Both methods depends on where you use it.
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Sep 10th, 2007
0

Re: how to have the code pause and then continue with a key stroke

There are different ways to approach this based on your actuall requirement.

-- You can use a timer and make the timer active when x=1 and inactive when its not.

-- else you can use the sleep and then resume when the value of x changes.

Both methods depends on where you use it.
Thank you Binoj for the prompt response.
For my code, either if I use the timer or sleep, x will not change by itself unless the program continues again.
Is there a way that sleep can be deactivated by a key stroke? Surprisingly VB6 doesn't recognizes Sleep!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nanoscientist is offline Offline
4 posts
since Sep 2007
Sep 10th, 2007
0

Re: how to have the code pause and then continue with a key stroke

See you can use the timer method and activate and deactivate the timer on a key event. To use the Sleep function you have import the API reference in your project.
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB 6.0 - How to programatically add a comment to spreadsheet
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Accessing Crystal Report





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC