HP 3000 Manuals

BACKSPACE Statement (Executable) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

BACKSPACE Statement (Executable) 

The BACKSPACE statement positions a sequential file or device at the
preceding record.

	       Click here to view figure.
            

----------------------------------------------------------------------------------------------
|                              |                              |                              |
|             Item             |     Description/Default      |         Restrictions         |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| unit                         | Expression giving the unit   | Must be a nonnegative        |
|                              | number of a connected file.  | integer.                     |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| variable_name                | Error code return.           | Must be an integer type.     |
| array_element                |                              |                              |
| scalar_record_field_name     |                              |                              |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| label                        | Statement label.             | Must be an executable        |
|                              |                              | statement in the same        |
|                              |                              | program unit as the          |
|                              |                              | BACKSPACE statement.         |
|                              |                              |                              |
----------------------------------------------------------------------------------------------

Semantics 

If the prefix UNIT= is omitted and the unit specifier is present, unit 
must be the first item in the list.

If the ERR specifier is present and an error occurs during execution of a
BACKSPACE statement, control transfers to the statement specified by
label rather than aborting the program.

If the IOSTAT specifier is present and an error occurs, the error code is
returned in the IOSTAT variable and the program is not aborted.  Refer to
Appendix A  for IOSTAT error codes.

If the file is positioned at its beginning, a BACKSPACE statement has no
effect.

As an extension to the ANSI 77 standard, BACKSPACE operations are allowed
on files open for direct access.  The file is positioned at the preceding
record, provided it is not already at the beginning of the file. 

                 Examples                                      Notes 

---------------------------------------------------------------------------------------

BACKSPACE 10                                The sequential file connected to unit 10 is
                                            backspaced one record.

BACKSPACE (UNIT=k+3,IOSTAT=j,ERR=100)       The file connected to unit k+3 is
                                            backspaced one record.  If an error occurs,
                                            control transfers to statement 100, and the
                                            error code is stored in variable j.  If no
                                            error occurs, j is set to 0, and control
                                            transfers to the next statement.

BACKSPACE (UNIT=k+3,IOSTAT=j)               The file connected to unit k+3 is
                                            backspaced one record.  If an error occurs,
                                            the error code is stored in the variable j.
                                            If no error occurs, j is set to 0.  In both
                                            cases, control transfers to the next
                                            statement.

BACKSPACE (UNIT=k+3,ERR=100)                The file connected to unit k+3 is
                                            backspaced one record.  If an error occurs,
                                            control transfers to statement 100.  If no
                                            error occurs, control transfers to the next
                                            statement.



MPE/iX 5.0 Documentation