home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 15.5. Page eject logic.
- 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
- */
-
- #define TOP_MAR 4
- #define BOT_MAR 6
- #define PAGE_LEN 66
-
- function Main()
- /*
- List vendor names, with a nice column heading.
- Eject to new page when we get too close to the bottom margin.
- */
- use vendor new
- goto top
- set device to printer
- setprc(0,0)
- @ prow() +TOP_MAR, 0 say "Vendor Name"
- @ prow() +1, 0 say "--------------------"
- do while .not. vendor->(eof())
- if (prow() +BOT_MAR) > PAGE_LEN
- eject
- setprc(0,0)
- @ prow() +TOP_MAR, 0 say ""
- endif
- @ prow() +1, 0 say vendor->Name
- skip alias vendor
- enddo
- eject
- set device to screen
- quit
- return nil
-
- // end of file CHP1505.PRG
-