forlang.hlp (Table of Contents; Topic list)
REWIND
                                             Up Contents Index Back
─────REWIND ────────────────────────────────────────────────────────────────
 
     Action
 
     Repositions a file to its first record.
 
     Syntax
 
     REWIND { unitspec |
     ([UNIT=]unitspec
     [ , ERR=errlabel]
     [ , IOSTAT=iocheck])}
 
     If UNIT= is omitted, <unitspec> must be the first parameter. The
     parameters can otherwise appear in any order.
 
     Parameter          Description
 
     unitspec           An integer expression specifying an external
                        unit.
 
     errlabel           The label of an executable statement in the same
                        program unit. An I/O error causes transfer of
                        control to the statement at <errlabel>. If
                        <errlabel> is omitted, the effect of an I/O
                        error is determined by the presence or absence
                        of <iocheck>.
 
     iocheck            An integer variable that is set to zero if
                        there is no error, or the error number if an
                        error occurs.
 
     Remarks
 
     If a parameter of the REWIND statement is an expression that
     calls a function, that function must not execute an I/O statement
     or the EOF intrinsic function. Calling these functions can cause
     unpredictable results.
 
     Example
 
           INTEGER int(80)
           .
           .
           .
           WRITE (7, '(80I1)') int
           .
           .
           .
           REWIND 7
           .
           .
           .
           READ  (7, '(80I1)') int
                                    -♦-