HP 3000 Manuals

The UNITCONTROL Procedure [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

The UNITCONTROL Procedure 

The UNITCONTROL procedure enables a FORTRAN 77 program to request several
actions for any FORTRAN logical unit.

The UNITCONTROL procedure is called from an HP FORTRAN 77 program as
follows:

     CALL UNITCONTROL(unit,opt)

----------------------------------------------------------------------------------------------
|              |                                                 |                           |
|     Item     |               Description/Default               |       Restrictions        |
|              |                                                 |                           |
----------------------------------------------------------------------------------------------
|              |                                                 |                           |
| unit         | Positive integer (INTEGER*2 or INTEGER*4) that  | Must be nonnegative.      |
|              | speccifies the unit number of the file to be    |                           |
|              | used.                                           |                           |
|              |                                                 |                           |
----------------------------------------------------------------------------------------------
|              |                                                 |                           |
| opt          | Integer (INTEGER*2 or INTEGER*4) that specifies | None.                     |
|              | the option (see table 5-1).                     |                           |
|              |                                                 |                           |
----------------------------------------------------------------------------------------------

The options for the UNITCONTROL intrinsic are listed in table 5-1.

          Table 5-1.  UNITCONTROL Options 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|                   Option                    |                 Description                 |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| -1                                          | Rewind (but don't close file).              |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| 0                                           | Backspace.                                  |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| 1                                           | Write an EOF mark.                          |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| 2                                           | Skip backward to a tape mark.               |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| 3                                           | Skip forward to a tape mark.                |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| 4                                           | Unload the tape and close the file.         |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| 5                                           | Leave the tape loaded and close the file.   |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| 6                                           | Convert the file to prespacing.             |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| 7                                           | Convert the file to postpacing.             |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| 8                                           | Close the file.                             |
|                                             |                                             |
---------------------------------------------------------------------------------------------

Refer to the HP FORTRAN 77/iX Programmer's Guide for an example of using
the UNITCONTROL intrinsic.



MPE/iX 5.0 Documentation