Progress
Language Tutorial
for Windows
Using PUT for Printer Control
When you send output to a printer, you may want to modify the way the printer generates that output. Many printers have a set of control sequences you can use to specify different print characteristics. You might, for example, want to change the number of printed characters per inch.
When you write a procedure that sends output to a printer, you can include printer control sequences within that procedure. Many control sequences involve special characters that can be represented by their octal (base 8) equivalent. To distinguish these octal codes, you precede the three octal digits by an escape character. Progress then converts the octal number to a single character.
On UNIX, the escape character is a tilde (~) or a backslash (\).
The PUT statement with the CONTROL option allows you to specify a control sequence to send to the printer. This is a partial syntax for this version of the PUT statement.
The control sequences you send to the printer have no effect on the current line, page counters, and positions maintained within Progress. Assume you want to print a report on your Brand X printer, using compressed-print mode.
The following procedure implements this task:
NOTE: This procedure works only if you have a printer connected to your system. Not all printers support compressed printing.These notes help to explain the code:
- The start-compress variable contains the four-character sequence that puts the printer into compressed-print mode. These four characters are octal 033 (decimal 27) followed by left bracket ([), 3, and w.
- The variable stop-compress takes the printer out of compressed print mode.
- When the user selects btn-normal, Progress runs the report in normal mode.
- When the user selects btn-compressed, Progress runs the report in compressed mode.
Control sequences are hardware-dependent, thus applications containing hard-coded printer control sequences are not easily portable to other environments. See the Progress Client Deployment Guide for more information about using the PUT CONTROL statement with control sequences.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |