home *** CD-ROM | disk | FTP | other *** search
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- '% (C) 1987 HUMBLEWARE Custom Programming Author: Lawrence A. Westhaver %
- '% 247 Paul Martin Drive, Baltimore MD 21227 (301) 799-1975 %
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- '% %
- '% FILENAME: PAUSE.SUB LAST UPDATE: 06-07-1987 %
- '% %
- '% DESCRIPTION: Pauses program execution for a specified number of seconds. %
- '% %
- '% CALL: CALL PAUSE(SECONDS%,KYBD%) %
- '% %
- '% INPUTS: SECONDS% = Number of seconds to pause program execution. %
- '% %
- '% KYBD% = Flag allowing or disallowing user interuption %
- '% from the keyboard. %
- '% %
- '% OUTPUTS: None. %
- '% %
- '% NOTE: This routine is accurate to approximately -1 second. %
- '% %
- '% If KYBD% is non-zero, this routine may be interupted by %
- '% pressing any key. Control then returns to the caller. %
- '% %
- '% If KYBD% is zero, this routine cannot be interupted from %
- '% the keyboard. Control returns to the caller only after %
- '% the specified number of seconds has elapsed. %
- '% %
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
- SUB PAUSE(SECONDS%,KYBD%) Static
-
-
- 'clear keyboard buffer
-
- IF KYBD% THEN
-
- DO
-
- CC$ = INKEY$
-
- LOOP UNTIL CC$ = ""
-
- END IF
-
-
- 'begin pause timer
-
- TIMER.COPY! = INT(TIMER)
-
- COUNTER% = 0
-
- DO
-
- IF INT(TIMER.COPY!) <> INT(TIMER) THEN
-
- TIMER.COPY! = INT(TIMER)
-
- COUNT% = COUNT% + 1
-
- IF COUNT% >= SECONDS% THEN
- EXIT DO
- END IF
-
- END IF
-
- IF KYBD% THEN
-
- CC$=INKEY$
-
- IF CC$ <> "" THEN
- EXIT DO
- END IF
-
- END IF
-
- LOOP
-
-
- END SUB 'pause
-
-