Closing a Device
Closing a device is rather simple: CLOSE will close any channel. On the final close of a device (if the device was OPENed on a channel more than once), PRO/5 may send a terminating sequence. As an example, a printer may be set up to perform a form-feed on the final close to set up the device for the next user.
On some systems, you may close the "write" side of a device without closing the entire I/O channel by writing with the IND=0 option. On these devices (called pipes), a write to index 0 will close the write side of the pipe. This is the only instance of a valid write with an index to a character device.
Controlling a Device
Devices recognized by PRO/5 are controlled using mnemonics. Mnemonics are used to control the way device I/O works. They prepare devices for the reception or transmission of data, or invoke a special function of the device. Some mnemonics set flags that are used during subsequent operations. Mnemonics are generally invoked with PRINT statements. Mnemonic constants are subject to TBL= conversion and are passed as data to the software driver for a particular device.