home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol8n05.zip / DELAY.BAS < prev    next >
BASIC Source File  |  1989-02-06  |  556b  |  18 lines

  1.  
  2.  Delay.start! = TIMER           'the start of the delay
  3.  Duration! = 1.5                'we want to wait 1.5 seconds
  4.  CLS
  5.  DO
  6.     'do any desired tasks
  7.     CALL Delay(Delay.start!, Duration!, Time.left!)
  8.  LOOP WHILE Time.left! > 0
  9.  
  10.  
  11.  SUB Delay (Start.time!, Dur!, Secs.left!) STATIC
  12.      IF TIMER >= Start.time! THEN       'same day as we started
  13.         Secs.left! = Start.time! + Dur! - TIMER
  14.      ELSE                               'we have passed midnight
  15.         Secs.left! = Start.time! + Dur! - TIMER - 86400
  16.      END IF
  17.  END SUB
  18.