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

  1. /*
  2.    Listing 15.4. Example of the control code technique, in context.
  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 COND_ON   sendCodes(chr(15))
  12. #define COND_OFF  sendCodes(chr(18))
  13.  
  14. function Main()
  15.   /*
  16.      Same vendor listing as before, but this time
  17.      using a better printer control code technique.
  18.   */
  19.   use vendor new
  20.   goto top
  21.   set device to printer
  22.   setprc(0,0)
  23.   do while .not. vendor->(eof())
  24.     @ prow() +1, 0 say Vendor->ID
  25.     @ prow(), pcol() +2 say Vendor->Name
  26.     COND_ON
  27.     @ prow(), pcol() +2 say Vendor->Address
  28.     @ prow(), pcol() +2 say vendor->City
  29.     @ prow(), pcol() +2 say vendor->State
  30.     @ prow(), pcol() +2 say vendor->Zip
  31.     COND_OFF
  32.     skip alias vendor
  33.   enddo
  34.   eject
  35.   set device to screen
  36.   quit
  37. return nil
  38.  
  39. // end of file CHP1504.PRG
  40.