home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / basic / tsrbas20.zip / SAVER.BAS < prev    next >
BASIC Source File  |  1991-04-03  |  1KB  |  38 lines

  1. 100 ' Screen Saver Demo Program, Version 1.0
  2. 110 ' 
  3. 120 ' The following line sets the saver delay interval,
  4. 130 ' in timer ticks, which are 18ths of a second. It
  5. 140 ' is set to 10 seconds for demo purposes.
  6. 150 '
  7. 160 saver_delay = 10 * 18
  8. 170 '
  9. 180 print "Press ctrl-shift-b to terminate saver."
  10. 190 '
  11. 200 ' The following statement does the actual terminate
  12. 210 ' and stay resident part. The parameters set up this
  13. 220 ' program to be recalled if a control-shift-b hotkey
  14. 230 ' sequence is entered or saver_delay ticks of keyboard
  15. 240 ' inactivity occur. 
  16. 250 '
  17. 260 suspend 0, 0x30, 0x06, 0, saver_delay, timer
  18. 270 '
  19. 280 ' The timer variable tells us why the suspend
  20. 290 ' statement returned. If it returned because the
  21. 300 ' hotkey sequence was entered then we terminate.
  22. 310 '
  23. 320 if not timer then cls : end
  24. 330 ' 
  25. 340 ' The following code is executed when the screen saver
  26. 350 ' kicks in. In this demo program it just saves the screen,
  27. 360 ' clears it and then waits for a keystroke. It could do
  28. 370 ' something much more elaborate, like the webb.bas
  29. 380 ' graphics display.
  30. 390 ' 
  31. 400 init
  32. 410 savescreen buf
  33. 420 blank
  34. 430 csroff
  35. 440 if inkey() = 0 then goto 440
  36. 450 restorescreen buf
  37. 460 goto 250
  38.