PREVIOUS-FUNCTION (op-code 7)

This routine behaves just like the NEXT routine with two exceptions. The first is that RETURN-CODE is set to the preceding record in the file instead of the next one. The second is that it never sets the W_DUP_OK error value. The PREVIOUS routine has two parameters, f, and record. F must be a valid file handle returned by OPEN. Record points to the area to hold the record read.

Some file systems do not support the ability to read a file backwards. For these systems, this routine sets the error value E_NO_SUPPORT.

This routine treats the beginning of the file in a manner that is analogous to the way NEXT treats the end of the file. If an PREVIOUS call reaches the beginning of the file, a call to NEXT returns the first record of the file.