home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 15.4. Example of the control code technique, in context.
- 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 COND_ON sendCodes(chr(15))
- #define COND_OFF sendCodes(chr(18))
-
- function Main()
- /*
- Same vendor listing as before, but this time
- using a better printer control code technique.
- */
- use vendor new
- goto top
- set device to printer
- setprc(0,0)
- do while .not. vendor->(eof())
- @ prow() +1, 0 say Vendor->ID
- @ prow(), pcol() +2 say Vendor->Name
- COND_ON
- @ prow(), pcol() +2 say Vendor->Address
- @ prow(), pcol() +2 say vendor->City
- @ prow(), pcol() +2 say vendor->State
- @ prow(), pcol() +2 say vendor->Zip
- COND_OFF
- skip alias vendor
- enddo
- eject
- set device to screen
- quit
- return nil
-
- // end of file CHP1504.PRG
-