FUNCTION sleep RETURNS INTEGER (msecs AS INTEGER):
DEFINE VARIABLE cFunction AS CHARACTER NO-UNDO INITIAL "sleep". DEFINE VARIABLE cLibrary AS CHARACTER NO-UNDO INITIAL "libc.so.1". DEFINE VARIABLE hCall AS HANDLE NO-UNDO. CREATE CALL hCall. ASSIGN cLibrary = "kernel32.dll" WHEN OPSYS = "WIN32" cFunction = "Sleep" WHEN OPSYS = "WIN32" hCall:CALL-NAME = cFunction hCall:LIBRARY = cLibrary hCall:CALL-TYPE = DLL-CALL-TYPE hCall:NUM-PARAMETERS = 1. hCall:SET-PARAMETER(1, "LONG", "INPUT", msecs). hCall:INVOKE( ). DELETE OBJECT hCall. RETURN msecs. END FUNCTION. |