home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP15.EXE / CHP1517.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  1.2 KB  |  39 lines

  1. /*
  2.    Listing 15.17. The PrintReady() user interface function.
  3.    Author: Craig Yellick
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. function PrintReady(r, c)
  12. /*
  13.    Checks printer port to be sure printer is ready,
  14.    then asks user if they are ready to print.
  15.    (Displays messages at specified coordinates.)
  16.    If printer isn't ready, keeps checking until it either
  17.    becomes available or the user hits a key.
  18. */
  19. local ready := .f.
  20.   @ r, c clear to r +2, maxCol()
  21.   if .not. isprinter()
  22.     @ r,    c say "Printer isn't responding..."
  23.     @ r +1, c say "Check that printer is turned on and is on-line."
  24.     @ r +2, c say "Press any key to abandon the report."
  25.   endif
  26.   do while .not. (isprinter() .or. inkey() <> 0)
  27.   enddo
  28.   @ r, c clear to r +2, maxCol()
  29.   if isprinter()
  30.     @ r,    c say "Ready to print..."
  31.     @ r +1, c say "Do you want to print the report?"
  32.     @ r +2, c say "Press Y to print or any other key to abandon it."
  33.     ready := (chr(inkey(0)) $ "Yy")
  34.     @ r, c clear to r +2, maxCol()
  35.   endif
  36. return ready
  37.  
  38. // end of file CHP1517.PRG
  39.