R-NEXT-FUNCTION (op-code 5)

This routine reads the next record in the sequence of records in a relative file. The R-NEXT-FUNCTION routine has two parameters: file_handle and record_area.

file_handle must be a valid file handle returned by R-OPEN-FUNCTION.
record_area    points to the area to hold the record read. It must be at least MAXSIZE bytes in length.

If R-NEXT-FUNCTION succeeds, RETURN-CODE is set to the size of the record read, plus one. If it fails, RETURN-CODE is set to zero. However, if the function fails because the record is locked, the file pointer is set to the locked record.

Records read in a file open for input only are not locked. Furthermore, most file systems do not block the reading of locked records in a file open for input (this feature depends on the host file system - not all support it). Records read from a file open for I/O are automatically locked unless the external variable f-no-lock is set to a non-zero value, in which case they are treated in the same manner as files open for input.