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

  1. /*
  2.    Listing 15.2. Why you should not make direct references
  3.                  to printhead positions
  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.  
  13. function Main()
  14.   /*
  15.      What's wrong with this code?
  16.   */
  17.   local line1, line2, i
  18.   set device to printer
  19.   line1 := 5
  20.   line2 := 6
  21.   @ line1, 0 say "Vendor"
  22.   @ line2, 0 say "------------"
  23.   i := 0
  24.   use vendor new
  25.   goto top
  26.   do while .not. vendor->(eof())
  27.     i ++
  28.     @ 3 +i, 0 say vendor->name
  29.     skip alias vendor
  30.   enddo
  31.   set device to screen
  32.   close databases
  33.   quit
  34. return nil
  35.  
  36. // end of file CHP1502.PRG
  37.