home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 15.17. The PrintReady() user interface function.
- Author: Craig Yellick
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- function PrintReady(r, c)
- /*
- Checks printer port to be sure printer is ready,
- then asks user if they are ready to print.
- (Displays messages at specified coordinates.)
- If printer isn't ready, keeps checking until it either
- becomes available or the user hits a key.
- */
- local ready := .f.
- @ r, c clear to r +2, maxCol()
- if .not. isprinter()
- @ r, c say "Printer isn't responding..."
- @ r +1, c say "Check that printer is turned on and is on-line."
- @ r +2, c say "Press any key to abandon the report."
- endif
- do while .not. (isprinter() .or. inkey() <> 0)
- enddo
- @ r, c clear to r +2, maxCol()
- if isprinter()
- @ r, c say "Ready to print..."
- @ r +1, c say "Do you want to print the report?"
- @ r +2, c say "Press Y to print or any other key to abandon it."
- ready := (chr(inkey(0)) $ "Yy")
- @ r, c clear to r +2, maxCol()
- endif
- return ready
-
- // end of file CHP1517.PRG
-