home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / BLANK1.PRG < prev    next >
Encoding:
Text File  |  1991-04-29  |  1.3 KB  |  47 lines

  1. /*
  2.     Program: BLANKSCR()
  3.     System: GRUMPFISH LIBRARY
  4.     Author: Greg Lief
  5.     Copyright (c) 1988-90, Greg Lief
  6.     Clipper 5.0 Version
  7.     Compile instructions: clipper blank1 /n/w/a
  8.     Blanks screen to prevent monitor wear and tear during inactivity
  9. */
  10.  
  11. //───── begin preprocessor directives
  12.  
  13. #include "setcurs.ch"
  14. #include "grump.ch"
  15.  
  16. //───── end preprocessor directives
  17.  
  18. function blankscr(delay)
  19. local mstart := seconds(), mtop, mbott, buffer
  20. do while nextkey() == 0 .and. seconds() - mstart < delay
  21. enddo
  22. if nextkey() == 0     && i.e., the do while loop timed out with no keypress
  23.    GFSaveEnv(.t., 0, 'w/n')
  24.    cls              // rather than just CLEAR, which zaps gets
  25.    ColorSet(C_MESSAGE)
  26.    mbott := (mtop := int(maxrow() / 2) - 2) + 3
  27.    SINGLEBOX(mtop, 25, mbott, 53)
  28.    @ mtop + 1, 27 ssay 'The screen has been saved'
  29.    @ mtop + 2, 27 ssay 'Push spacebar to continue'
  30.    setcolor('w/n')
  31.    buffer := savescreen(mtop, 25, mbott, 53)
  32.    mstart := seconds()
  33.    do while inkey() == 0
  34.       if seconds() - mstart > 10
  35.          scroll(mtop, 25, mbott, 53, 0)
  36.          mtop := if(mtop > maxrow() - 4, 0, mtop + 1)
  37.          mbott := if(mbott == maxrow(), 3, mbott + 1)
  38.          restscreen(mtop, 25, mbott, 53, buffer)
  39.          mstart := seconds()
  40.       endif
  41.    enddo
  42.    GFRestEnv()
  43. endif
  44. return NIL
  45.  
  46. * eof blank1.prg
  47.