HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
REWIND
Chapter 10454
REWIND
Positions file at its initial point.
Syntax
The syntax of the REWIND statement can take one of the following forms:
Short form:
integer-expression
Long form:
REWIND (
io-specifier-list
)
integer-expression
is the unit connected to a sequential file or device.
io-specifier-list
is a list of the following comma-separated I/O specifiers:
[UNIT=]
unit
specifies the unit connected to an external file opened for sequential access.
unit
must be an integer expression that evaluates to a number greater than
0. If the optional keyword UNIT= is omitted,
unit
must be the first item in
io-specifier-list
.
ERR=
stmt-label
specifies the label of the executable statement to which control passes if an
error occurs during statement execution.
IOSTAT=
integer-variable
returns the I/O status after the statement executes. If the statement
executes successfully,
integer-variable
is set to zero. If an error occurs, it
is set to a positive integer that indicates which error occurred.
Description
The REWIND statement repositions the file connected to the specified unit at the start of the
first record. If the file is already at its starting point or if the unit is not connected to a file, the
REWIND statement has no effect.