home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
QBAS
/
WNDTOOL5.ZIP
/
WAIT.SUB
< prev
next >
Wrap
Text File
|
1989-04-26
|
3KB
|
60 lines
'
'$PAGE
'
'******************************************************************************
' Function : *
' *
' Purpose: *
' *
' *
' Results: *
' *
' Usage : *
' *
' *
' Date Written : 01/01/89 - Date Tested: 01/01/89 - Author: James P Morgan *
' Date Modified: - : - : *
'-----------------------------------------------------------------------------*
' NOTE: *
'******************************************************************************
' *
' SUB PROGRAM NAME (PARAMETERS) STATIC/RECURSIVE *
'-----------------------------------------------------------------------------*
' *
'============================================================================
'
'============================================================================
'
SUB WAITTIME(WTIME!) STATIC
'
'Changed "WTIME%" to "WTIME!" to allow fractions of seconds to be passed
'as documented in the manual (JP -2/4/88)
DEFINT A-Z 'make all short intergers by default
IF WTIME!<=0.0! THEN 'valid time interval (not negative)?
WTIME!=1.0! 'NO, so default to 1 second
ELSEIF WTIME!>86399! THEN 'more than the total seconds in a day?
WTIME!=1.0! 'default to 1 second
END IF
OLDTIME!=TIMER
NEWTIME!=OLDTIME!+WTIME!
WAIT.T.LOOP:
CURTIME!=TIMER
IF CURTIME!<OLDTIME! THEN 'in case of midnite rollover
CURTIME!=CURTIME!+86400!
END IF
IF CURTIME! >= NEWTIME! THEN 'has the wait time elapsed?
EXIT SUB 'yes, return to caller
END IF
IF INKEY$<>CHR$(27) THEN 'allow ESC key to break out of timer
GOTO WAIT.T.LOOP
END IF
EXIT SUB 'ESC pressed, return to caller
END SUB