Output to Devices
Devices are written to in a manner similar to files; the fields in the output list are successively sent to the device. The characters sent to a device may be translated using the "TBL=" option. This option works in a similar manner to that of the TBL() function. Additional information may be found in the documentation of the TABLE command.
Logically, the system handles output one character at a time. This allows the timeout (set by the TIM= I/O option) to function whenever PRO/5 is delayed in sending the output. This is different from file output where PRO/5 locks the area to be written prior to attempting to write. The lock guarantees that the write may be performed. The timeout function is performed on the lock.
Simultaneous Input and Output
Some devices allow reading and writing at the same time in the INPUT command. On a terminal, this allows the user to be prompted and the response accepted and verified in the same line of code, as in:
INPUT (0,ERR=1010)@(10,23),"Is the data correct?",'CL',X$:
: ("Y"=1020,"y"=1020,"N"=6000,"n"=6000)
This code fragment places the cursor to column 10, line 23 of the display, and writes the "Is the data correct? (Y/N)" message. It then clears the remainder of the line and accepts a response of either a "Y" or a "N" character. Execution continues at either line 1020 or 6000, depending on user response. Explanations of the input verification and branch list may be found with the READ command. Explanations of the @() and 'CL' mnemonics are found in their respective sections.
On some systems, devices other than the terminal may allow reading and writing in the same I/O command.