READ program instruction READ program instruction Syntax READ (lun, record_num, mode ) var_list Function Read a record from an open file or from an attached device that is not file oriented. For an network device, read a string from an attached and open TCP connection. Usage Considerations The logical unit referenced by this instruction must have been attached previously. For file-oriented devices, a file must already have been opened with an FOPEN_ instruction. Parameters lun Real-valued expression that identifies the device to be accessed.
(See the ATTACH instruction for a description of unit numbers.) record_num Optional real-valued expression that specifies the record to read for file-oriented devices opened in random-access mode (see the FOPEN_ instructions). For nonfile-oriented devices or for sequential access of a file, this parameter should be 0 or omitted. Records are numbered from one to a maximum of 16,777,216. When accessing the TCP device with a server program, this parameter is an optional real variable that returns the client handle number. The handle can be used to identify the client accessing a multiple-client server. mode Optional real-valued expression that specifies the mode of the read operation.
Currently, the mode is used only for the terminal and serial I/O logical units. The value is interpreted as a sequence of bit flags as detailed below. (All bits are assumed to be clear if no mode value is specified.) Bit 1 (LSB) Wait (0) vs. No-wait (1) (mask value = 1) If this bit is clear, program execution is suspended until the read operation is completed. If the bit is set and the requested data is not available, program execution continues immediately and the IOSTAT function returns the error code for *No data received* (-526). eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 424