Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
>What is the best way to PAUSE program execution for 1 second at a time, regardless of Keyboard activity?
>I am generating Time Stamps, ,but when keyboard is pressed, the WAIT statement gets bypassed and my Time Stamps repeat.
>
>.
>Thanks
SLEEP.PRG
LPARAMETERS m.tnMilliseconds
DECLARE Sleep IN kernel32 INTEGER m.tnMilliseconds
RETURN Sleep(m.tnMilliseconds)
Anytime you want to make it sleep for 1 second, call sleep(1000). Have sleep.prg in your path at design time. Have sleep.prg in the project by itself so it is called at run time (in the exe) without any need for set procedure. The first time you try to call sleep it will declare the dll and then call the dll. The second time - if you have not released the dll, it will not call sleep.prg at all, but will call the sleep dll directly.
Also this gives you one place and only one place to change how the declare is coded - instead of having many copies of the declare command all throughout your code base(s).
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only