home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a013 / 1.ddi / SOURCE.EXE / F_PRNCHK.PRG < prev    next >
Encoding:
Text File  |  1991-01-25  |  1.2 KB  |  46 lines

  1. *****************************************************************
  2. FUNCTION PRNCHECK (msg_line)
  3. *****************************************************************
  4.  
  5. * Displays a message if printer is not ready
  6.  
  7. * Copyright(c) 1991 -- James Occhiogrosso
  8.  
  9. # include "inkey.ch"
  10.  
  11. LOCAL old_screen := '', keypress := 0
  12.  
  13. * Initialize message line if not passed
  14. msg_line := IF(msg_line = NIL, MAXROW(), msg_line)
  15.  
  16. IF .NOT. ISPRINTER()
  17.    * Wait 1 second just in case print buffer is full.
  18.    * For slower printers, increase time delay.
  19.    PAUSE(1)
  20. ENDIF
  21.  
  22. * Try again. If printer still is not ready, display a message.
  23. * Wait for operator to press Esc or make printer ready
  24.  
  25. IF .NOT. ISPRINTER()
  26.  
  27.    * Save message line screen
  28.    old_screen = SCRNSAVE(msg_line, 0, msg_line, MAXCOL())
  29.  
  30.    * Sound bell and display a message
  31.    ?? CHR(7)
  32.    CENTERON(msg_line, 'Your printer is not ready! ' + ;
  33.                       'Correct or press Esc to abort.')
  34.  
  35.    * Wait for printer to be ready, or Esc key to be pressed
  36.    DO WHILE .NOT. ISPRINTER() .AND. keypress != K_ESC
  37.        keypress = INKEY()
  38.    ENDDO
  39.  
  40.    * Restore message line screen
  41.    SCRNREST(old_screen)
  42.  
  43. ENDIF
  44. RETURN( IF(keypress = K_ESC, .F.,.T.) )
  45.  
  46.