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

  1. /*
  2.    Listing 15.8. A new version of the previous page eject 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. #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. Correctly handles
  20.    situation where printer is already positioned
  21.    at the top of a page.
  22. */
  23. local need_eject := ((prow() +BOT_MAR) > PAGE_LEN) ;
  24.                 .or. (prow() = 0)
  25.   if need_eject
  26.     if prow() > 0
  27.       eject
  28.       setprc(0,0)
  29.     endif
  30.     @ prow() +TOP_MAR, 0 say ""
  31.   endif
  32. return need_eject
  33.  
  34. // end of file CHP1508.PRG
  35.