HP 3000 Manuals

Unformatted Input/Output [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

Unformatted Input/Output 

Unformatted input/output allows you to transfer data in internal
representation (binary).  Each unformatted input/output statement
transfers exactly one record.  Unformatted input/output to devices is
done in binary mode.

Unformatted Input 

Unformatted input is specified by the following input statement.  Only
the brief forms of the relevant syntax elements are shown here.  For the
complete syntax, refer to "READ Statement (Executable)" . 

Syntax 

READ ( unit [...] ) list 

-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
|       Item        |        Description/Default         |            Restrictions            |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| unit              | Unit number of the file.           | None.                              |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| list              | List of variables that specifies   | None.                              |
|                   | where the data is to be            |                                    |
|                   | transferred.                       |                                    |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------

If list is omitted, the file is moved to the next record without data
transfer.  The list can contain implied DO loops.  For syntax and
detailed information on implied DO loops, refer to "DO Statement
(Executable)" .

With unformatted input, the format specifier (FMT) cannot be present in
the WRITE statement.

Because only one record is read when an unformatted READ statement is
executed, the number of list elements must be less than or equal to the
number of values in the record.  A complex item requires two real values.

The type of each input value should agree with the type of the
corresponding list item.  A complex value in the input record, however,
can correspond to two real list items, or two real values can correspond
to one complex list item.

The data is transferred exactly as it is written; thus, no precision is
lost.

Unformatted Output 

Unformatted output is specified by the following output statement.  Only
the brief forms of the relevant syntax elements are shown here.  For the
complete syntax, refer to "WRITE Statement (Executable)" . 

Syntax 

WRITE ( unit ) [,] list 

-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
|       Item        |        Description/Default         |            Restrictions            |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| unit              | Unit number of the file.           | None.                              |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| list              | List of variables or expressions   | None.                              |
|                   | that specifies the data to be      |                                    |
|                   | transferred.                       |                                    |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------

The list can contain implied DO loops.  For syntax and detailed
information on implied DO loops, refer to "DO Statement (Executable)"
.  If list is omitted, an empty record is written.  If list contains a
function reference, that function must not contain any READ or WRITE
statements.

With unformatted output, the format specifier FMT cannot be present in
the WRITE statement.

The output list must not specify more values than can fit into one
record.  If the specified values do not fill the record, the remainder of
the record is undefined.



MPE/iX 5.0 Documentation