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

  1. /*
  2.    Listing 15.13. More efficient way to produce standard headings.
  3.    NOTE: This is a code fragment... do not compile and use as-is!!
  4.    Author: Craig Yellick
  5.    Excerpted from "Clipper 5: A Developer's Guide"
  6.    Copyright (c) 1991 M&T Books
  7.                       501 Galveston Drive
  8.                       Redwood City, CA 94063-4728
  9.                       (415) 366-3600
  10. */
  11.  
  12. #define TOP_MAR   4
  13. #define BOT_MAR   6
  14. #define PAGE_LEN  66
  15.  
  16. function Main()
  17. /*
  18.    The "meat" of the previous vendor listing again,
  19.    this time handling page and column headings more efficiently.
  20. */
  21.   do while .not. vendor->(eof())
  22.     if PageEject(page_len, top_mar, bot_mar)
  23.       page_number++
  24.       PageHead(sys_title, rpt_title, rpt_id, ;
  25.                page_width, left_mar, right_mar, page_number)
  26.       @ prow() +2, left_mar say col_head1
  27.       @ prow() +1, left_mar say col_head2
  28.     endif
  29.     @ prow() +1, left_mar say vendor->name
  30.     @ prow(), pcol() +2 say vendor->address
  31.     @ prow(), pcol() +2 say vendor->ytd picture "$9,999.99"
  32.     @ prow(), pcol() +6 say if(vendor->contract, "Yes", "No")
  33.     skip alias vendor
  34.   enddo
  35. return nil
  36.  
  37. // end of file CHP1513.PRG
  38.