Consultor Eletrônico



Kbase P20344: How to achieve a pause shorter than 1 second on Windows?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/08/2006
Status: Verified

GOAL:

How to achieve a pause shorter than 1 second ?

GOAL:

How to pause less than a second.

FACT(s) (Environment):

Windows

FIX:

The PAUSE n statement is used to allow Progress/OpenEdge to suspend processing for n seconds, or until the user presses any key. The PAUSE statement cannot handle a time shorter than one second.

The following sample code shows how to call the Win32 API function called Sleep in Kernel32.dll. This function suspends execution of the current thread (i.e. Progress) for a specified interval:

PROCEDURE Sleep EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER intMilliseconds AS LONG NO-UNDO.
END PROCEDURE.


RUN Sleep (100). /* Pause for 100 milliseconds */