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

  1. /*
  2.    Listing 15.5. Page eject logic.
  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 Main()
  16.   /*
  17.      List vendor names, with a nice column heading.
  18.      Eject to new page when we get too close to the bottom margin.
  19.   */
  20.   use vendor new
  21.   goto top
  22.   set device to printer
  23.   setprc(0,0)
  24.   @ prow() +TOP_MAR, 0 say "Vendor Name"
  25.   @ prow() +1,       0 say "--------------------"
  26.   do while .not. vendor->(eof())
  27.     if (prow() +BOT_MAR) > PAGE_LEN
  28.       eject
  29.       setprc(0,0)
  30.       @ prow() +TOP_MAR, 0 say ""
  31.     endif
  32.     @ prow() +1, 0 say vendor->Name
  33.     skip alias vendor
  34.   enddo
  35.   eject
  36.   set device to screen
  37.   quit
  38. return nil
  39.  
  40. // end of file CHP1505.PRG
  41.