home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / basic / timer.bas < prev    next >
Encoding:
BASIC Source File  |  1989-11-09  |  581 b   |  28 lines

  1. ' Declare external MASM procedures.
  2. DECLARE SUB SetInt
  3. DECLARE SUB RestInt
  4.  
  5. ' Install new interrupt service routine.
  6. CALL SetInt
  7.  
  8. ' Set up the BASIC event handler.
  9. ON UEVENT GOSUB SpecialTask
  10. UEVENT ON
  11.  
  12. DO
  13. ' Normal program operation occurs here.
  14. ' Program ends when any key is pressed.
  15. LOOP UNTIL INKEY$ <> ""
  16.  
  17. ' Restore old interrupt service routine before quitting.
  18. CALL RestInt
  19.  
  20. END
  21.  
  22. ' Program branches here every 4.5 seconds.
  23. SpecialTask:
  24. ' Code for performing the special task goes here, for example:
  25. PRINT "Arrived here after 4.5 seconds."
  26. RETURN
  27.  
  28.