wcglorioso
Programmer
Here are several functions I know which introduce time delays:
INKEY([nSeconds] [, cHideCursor])
nSeconds
= Specifies how many seconds INKEY( ) waits for a keystroke
WAIT [cMessageText] [TO VarName] [WINDOW [AT nRow, nColumn]] [NOWAIT][CLEAR | NOCLEAR] [TIMEOUT nSeconds]
TIMEOUT nSeconds
= Specifies the number of seconds that can elapse without input from the keyboard or the mouse before the WAIT is terminated
= specifies the number seconds (fractional seconds are permitted) that elapse
MESSAGEBOX(eMessageText [, cTitleBarText][, nDialogBoxType ][, nTimeout])
nTimeout
= Specifies the number of milliseconds Visual FoxPro displays cMessageText without input from the keyboard or the mouse before clearing cMessageText
Except INKEY(), all other functions has visible output trace on screen unless INKEY() is set to show the cursor by including S in its cHideCursor parameter.
The WAIT function is much better than MESSAGEBOX() function in specifying millisecond delays but both will not precisely introduce the required millisecond delay because the time delay may prematurely elapse upon key press or mouse click at some time (sois INKEY() function).
*** WAIT time delay version
LOCAL lnstart, tDelay
tDelay=500 && millisec delay
lnstart=SECONDS()
WAIT WINDOW 'Please Wait...' TIMEOUT 0.5
MESSAGEBOX(SECONDS()-lnstart)
*** MESSAGEBOX() time delay version
LOCAL lnstart, tDelay
tDelay=500
lnstart=SECONDS()
MESSAGEBOX('Please wait...',0,'Time Delay',tDelay)
MESSAGEBOX((SECONDS()-lnstart)*1000)
INKEY has a limit of specifying and integer value for its nSeconds parameter "as documented" (or as I understand the documentation) but it can it also permit fractional seconds like WAIT as it turned out with the following codes:
*** INKEY() time delay version
LOCAL lnstart, tDelay
tDelay=500 && millisec delay
lnstart=SECONDS()
=INKEY(tDelay/1000)
MESSAGEBOX(SECONDS()-lnstart)
However, I have below my version of a time delay which is as precise as that of the preceeeding codes but does not have a visual trace or affected by key press or mouse click.
*** SECONDS() time delay version
LOCAL lnstart, tDelay
tDelay=500
lnstart=SECONDS()
DO WHILE (SECONDS()-lnstart)*1000 < tDelay
ENDDO
MESSAGEBOX(SECONDS()-lnstart)
I hope this qualifies as a good enough tip
INKEY([nSeconds] [, cHideCursor])
nSeconds
= Specifies how many seconds INKEY( ) waits for a keystroke
WAIT [cMessageText] [TO VarName] [WINDOW [AT nRow, nColumn]] [NOWAIT][CLEAR | NOCLEAR] [TIMEOUT nSeconds]
TIMEOUT nSeconds
= Specifies the number of seconds that can elapse without input from the keyboard or the mouse before the WAIT is terminated
= specifies the number seconds (fractional seconds are permitted) that elapse
MESSAGEBOX(eMessageText [, cTitleBarText][, nDialogBoxType ][, nTimeout])
nTimeout
= Specifies the number of milliseconds Visual FoxPro displays cMessageText without input from the keyboard or the mouse before clearing cMessageText
Except INKEY(), all other functions has visible output trace on screen unless INKEY() is set to show the cursor by including S in its cHideCursor parameter.
The WAIT function is much better than MESSAGEBOX() function in specifying millisecond delays but both will not precisely introduce the required millisecond delay because the time delay may prematurely elapse upon key press or mouse click at some time (sois INKEY() function).
*** WAIT time delay version
LOCAL lnstart, tDelay
tDelay=500 && millisec delay
lnstart=SECONDS()
WAIT WINDOW 'Please Wait...' TIMEOUT 0.5
MESSAGEBOX(SECONDS()-lnstart)
*** MESSAGEBOX() time delay version
LOCAL lnstart, tDelay
tDelay=500
lnstart=SECONDS()
MESSAGEBOX('Please wait...',0,'Time Delay',tDelay)
MESSAGEBOX((SECONDS()-lnstart)*1000)
INKEY has a limit of specifying and integer value for its nSeconds parameter "as documented" (or as I understand the documentation) but it can it also permit fractional seconds like WAIT as it turned out with the following codes:
*** INKEY() time delay version
LOCAL lnstart, tDelay
tDelay=500 && millisec delay
lnstart=SECONDS()
=INKEY(tDelay/1000)
MESSAGEBOX(SECONDS()-lnstart)
However, I have below my version of a time delay which is as precise as that of the preceeeding codes but does not have a visual trace or affected by key press or mouse click.
*** SECONDS() time delay version
LOCAL lnstart, tDelay
tDelay=500
lnstart=SECONDS()
DO WHILE (SECONDS()-lnstart)*1000 < tDelay
ENDDO
MESSAGEBOX(SECONDS()-lnstart)
I hope this qualifies as a good enough tip