Working with printers
KCML programs traditionally treat printers as character devices. Printing can be done by the terminal or client (called local printing) or can be sent to a printer attached to the server. A further option is to connect to a network printer like Kprint.
The program generates printed output using the PRINT and PRINTUSING statments having first SELECTed the required print device with SELECT PRINT. The device should have been previously defined by $DEVICE and locked with $OPEN e.g.
$DEVICE /015="LPT1"
SELECT #9/015 $OPEN #9
SELECT PRINT #9
PRINT "Hello"
SELECT PRINT /005
$CLOSE #9
Locking with $OPEN is necessary because
The normal line terminating character in KCML is the HEX(0D) carriage return. Some older printers had hardware support for this but today most printers will expect the application to terminate lines with HEX(0D0A). KCML supports a mechanism to control the line terminator by setting the first digit of the device address to '0' (for automatic addition of a HEX(OA) or '2' to just pass the HEX(0D) through. The example above uses '0 to achieve this. For more about using the first digit to set the line terminator see the PRINT statement.
See Also
Working with local printers