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

  1. /*
  2.    Listing 15.18. Checking for user-requested interruptions.
  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 CheckAbort(r, c)
  12. /*
  13.    If a keystroke is in the buffer, display prompt
  14.    and wait for user response. Returns true if user
  15.    wants to abort report.
  16. */
  17. local abort := .f.
  18.   if inkey() <> 0
  19.     set device to screen
  20.     @ r, c clear to r +1, maxCol()
  21.     @ r,    c say "Printing paused..."
  22.     @ r +1, c say "Do you want to abort the report?"
  23.     abort := (chr(inkey(0)) $ "Yy")
  24.     @ r, c clear to r +1, maxCol()
  25.     if .not. abort
  26.       set device to printer
  27.     endif
  28.   endif
  29. return abort
  30.  
  31. // end of file CHP1518.PRG
  32.