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

  1. /*
  2.    Listing 15.6. A more efficient way to detect the need for page eject
  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. #define TOP_MAR   4
  12. #define BOT_MAR   6
  13. #define PAGE_LEN  66
  14.  
  15. function PageEject()
  16. /*
  17.    Check to see if it's time to eject the page.
  18.    If so, eject and move down beyond top margin.
  19.    Return .t. if we ejected.
  20. */
  21. local need_eject := (prow() +BOT_MAR) > PAGE_LEN
  22.   if need_eject
  23.     eject
  24.     setprc(0,0)
  25.     @ prow() +TOP_MAR, 0 say ""
  26.   endif
  27. return need_eject
  28.  
  29. // end of file CHP1506.PRG
  30.