Device File Types

A device is any file other than a disk file. Common devices on any computer system are terminals and printers. More exotic devices could be magnetic tape drives or optical readers.

PRO/5 provides support for device features by using mnemonics, which are special commands used in output verbs to perform special operations on different devices. Mnemonics remove the need for the programmer to know specific escape sequences used by different devices. Although PRO/5 will support many different mnemonics for different devices, the programmer must ultimately decide whether a given mnemonic is reasonably portable.

Opening a Device

In PRO/5, a device is associated with a channel using the OPEN verb. The channel specified in the command must not already be OPENed to another file or device. As an example:

>OPEN (1)"T1"

When the OPEN is performed, PRO/5 will initialize the device if it is a device which appeared in the ALIAS list loaded from the PRO/5 configuration file. This initialization is necessary for PRO/5 to have an understanding of the specific attributes unique to this device. The initialization will not occur if you have the device opened on another channel as the new OPEN is not a unique open of the device.

The OPEN may specify additional modes that are specific to the host operating system or to the device being opened as in:

>OPEN (1,MODE=M$)DEVICE$

The modes specified are defined in a string, each "value" separated by a "," or ";". The modes supported by PRO/5 are defined in the The config.bbx Configuration File.