Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keyboard '{Pause} nSeconds'

Status
Not open for further replies.

jonscott8

Programmer
May 12, 2000
1,317
US
I'm curious if anyone has done any testing with this command? (In my very brief testing), It appears that it only pauses user interaction, not code execution.

Anyone already done the testing and care to share your findings?

In my testing, if you:

KEYBOARD '{pause 10}'
MESSAGEBOX('Can't click me!',0,'Not So Fast, Bud!')

After executing the KEYBOARD command, the messagebox immediately appears; however, the user is "dead in the water" for 10 seconds. Jon Hawkins
jonscott8@yahoo.com

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
I suppose you could combine it with the WAIT command...

KEYBOARD '{pause 10}'
WAIT
MESSAGEBOX("I'll have a bottled import.",0,"What is going on!")

This should pause program execution for minimum 10 seconds then continue whenever a key was pressed.
-Pete
 
Jon

I'm curious as to WHY you are testing this command?

So Jon, could you enlighten us on what you are trying to achieve? (Sound familiar, Jon? :))

Chris
 
I will assume that you want to send your program to sleep for a while waiting for any proccess to finsh. In this case use...
Code:
DECLARE INTEGER Sleep In Win32API INTEGER Milliseconds
and then use
Code:
*-- Example if X=1000, this is 1 second
=sleep(X)
In your program. This will pauses the code execution for X/1000 seconds

Thanks
Walid Magd
Engwam@Hotmail.com

 
Chris,

I was testing this command because it is an undocumented VFP command. I'm not trying to achieve anything. I was just curious if anyone had discovered a practical use for it.

Walid,

I use the SLEEP function in my PAUSE_SYNCHRONOUSLY function. The only problem is it cripples the entire thread, including any code fired in timer events and COM objects.

So if your requirement is to simply pause the current execution, you find yourself implementing a polling state:

DO WHILE SECONDS()<=ltTimeOut
DOEVENTS
ENDDO

For more info on the {PAUSE nSeconds} option, see:

INFO: Undocumented {PAUSE} Option for KEYBOARD Command
Jon Hawkins
jonscott8@yahoo.com

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top