


The C$LOCALPRINT routine provides access to the ACUCOBOL-GT window manager's local print mechanism. This allows the program to write to a printer or other device attached directly to the user's terminal. One or two USING parameters should be provided.
Usage
CALL "C$LOCALPRINT" USING SOURCE-DATA, LINE-SPACE
Parameters
SOURCE-DATA PIC X(n)
This contains the data that will be sent to the local device. Any trailing spaces will be removed before the data is sent.
LINE-SPACE (optional) Numeric parameter
The second parameter, if specified, determines the line spacing provided by the routine. Its value is interpreted as follows:
| 0
| No additional characters are sent after the data
|
| 1
| A carriage return is sent after the data
|
| 2
| A carriage return and a line feed are sent after the data
|
| 3
| A carriage return and a form feed are sent after the data |
You may add either or both of the following values to the value contained in the second parameter:
| +10
| Any line-advancing control sequences are sent before the data instead of after.
|
| +20
| Inhibits the sending of the disable-printer terminal sequence after sending the data. |
A second parameter value of "8" (with a dummy first parameter) causes the disable-print sequence to be sent to the terminal on its own.
Description
When this routine executes, it performs the following steps in this order:
1. The terminal's Enable Print command is sent. This causes subsequent data sent to the terminal to be also sent to the attached device.
2. The data specified in the first USING parameter (less trailing spaces) is sent to the terminal. No interpretation or modification is done to this data.
3. The appropriate line spacing characters specified by the second USING parameter are sent to the terminal.
4. The terminal's Disable Print command is sent. This turns off the pass-through mode.
5. The current cursor location is set to the home position of the current window. The window manager is instructed to define the current screen state as "undefined". This causes the window manager to behave correctly if the terminal's pass-through mode is destructive to the screen (e.g., characters appear on the screen as well as being sent to the attached device).
On MS-DOS systems, the C$LOCALPRINT routine simulates local printing via the following procedure. When the routine is called for the first time, the runtime system opens a file to which it writes the passed data. The name of the file is determined by the setting of the environment variable LPRINTER. Usually this will be set to the name of a device such as PRN, COM1, LPT1, and so forth. If this variable is not set, then the default name PRN is used.