home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 15.10. Printing with page and column headings, a first attempt.
- NOTE: This is a code fragment... do not compile and use as-is!!
- 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()
- /*
- The venerable Vendor Listing again, this time with
- both page and column headings on every page.
- */
- local page_number, page_id1, page_id2
-
- use vendor new
- set filter to vendor->ytd > 0
- goto top
- set device to printer
- setprc(0,0)
- page_number := 0
- do while .not. vendor->(eof())
- if PageEject(page_len, top_mar, bot_mar)
- page_number++
- page_id1 := dtoc(date()) +" " +rpt_id
- page_id2 := time() +" Page " +ltrim(str(page_number))
- @ prow() +1, left_mar say sys_title
- @ prow(), (page_width -(len(page_id1) +right_mar)) say page_id1
- @ prow() +1, left_mar say rpt_title
- @ prow(), (page_width -(len(page_id2) +right_mar)) say page_id2
- @ prow() +2, left_mar say col_head1
- @ prow() +1, left_mar say col_head2
- endif
- @ prow() +1, left_mar say vendor->name
- @ prow(), pcol() +2 say vendor->address
- @ prow(), pcol() +2 say vendor->ytd picture "$9,999.99"
- @ prow(), pcol() +6 say if(vendor->contract, "Yes", "No")
- skip alias vendor
- enddo
- @ prow() +2, left_mar say "*** End of Report ***"
- eject
- set device to screen
- close databases
- quit
- return nil
-
- // end of file CHP1510.PRG
-