home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Database / CLIPR503.W96 / PRINT.PR_ / PRINT.PR
Text File  |  1995-06-20  |  1KB  |  42 lines

  1. /***
  2. *
  3. *  Print.prg
  4. *
  5. *  Sample user-defined functions for controlling the printer
  6. *
  7. *  Copyright (c) 1993-1995, Computer Associates International Inc.
  8. *  All rights reserved.
  9. *
  10. *  NOTE: Compile with /a /m /n /w
  11. *
  12. */
  13.  
  14.  
  15. /***
  16. *
  17. *  PrintCodes( <cCtrlCode> )
  18. *
  19. *  Send control codes to the printer without affecting printhead position
  20. *
  21. *  Usage:
  22. *         PrintCodes( CHR (27 ) + "E" )
  23. *         ?? "Some Text"
  24. *         PrintCodes( CHR( 27 ) + "F" )
  25. *         ?? "More Text"
  26. *
  27. */
  28. PROCEDURE PrintCodes( cCtrlCode )
  29.  
  30.    LOCAL nRow     := PROW()                     // Save the current row
  31.    LOCAL nCol     := PCOL()                     // Save the current column
  32.    LOCAL lPrinter := SET( _SET_PRINTER, .T. )   // SET PRINTER ON
  33.    LOCAL lConsole := SET( _SET_CONSOLE, .F. )   // SET CONSOLE OFF
  34.  
  35.    ?? cCtrlCode                  // Send the code(s) to the printer
  36.  
  37.    SETPRC( nRow, nCol )          // Restore the previous row/column settings
  38.    SET( _SET_PRINTER, lPrinter ) // Restore printer setting
  39.    SET( _SET_CONSOLE, lPrinter ) // Restore console setting
  40.  
  41.    RETURN
  42.