home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a009 / 6.ddi / SAMPLE.LIF / PRINT.PRG < prev    next >
Encoding:
Text File  |  1991-04-14  |  902 b   |  38 lines

  1. /***
  2. *
  3. *     Print.prg
  4. *     Sample user-defined functions for controlling the printer
  5. *     Copyright, Nantucket Corporation, 1990
  6. *
  7. *      NOTE: compile with /n/w/a/m
  8. */
  9.  
  10. #include "Set.ch"
  11.  
  12.  
  13. /***
  14. *  PrintCodes( <cCtrlCode> ) --> NIL
  15. *  Send control codes to the printer without affecting printhead position.
  16. *
  17. *  Usage:
  18. *         PrintCodes( CHR(27)+"E" )
  19. *         ?? "Some Text"
  20. *         PrintCodes( CHR(27)+"F" )
  21. *         ?? "More Text"
  22. *
  23. */
  24. PROCEDURE PrintCodes( cCtrlCode )
  25.    LOCAL nRow := PROW() 
  26.    LOCAL nCol := PCOL()
  27.    LOCAL lPrinter := SET(_SET_PRINTER, .T.)     // SET PRINTER ON
  28.    LOCAL lConsole := SET(_SET_CONSOLE, .F.)     // SET CONSOLE OFF
  29.  
  30.    ?? cCtrlCode
  31.  
  32.    SETPRC(nRow, nCol)
  33.    SET(_SET_PRINTER, lPrinter)                  // Restore printer setting
  34.    SET(_SET_CONSOLE, lPrinter)                  // Restore console setting
  35.  
  36.    RETURN 
  37.  
  38.