HP 3000 Manuals

Carriage Control Files [ HP FORTRAN 77/iX Programmer's Guide ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Programmer's Guide

Carriage Control Files 

The preconnected unit six (FTN06) is opened with carriage control (CCTL).
When initially opening empty files (EOF points to zero), the CCTL bit and
the device type are checked.  The appropriate FWRITE is then performed to
set the file for prespacing.  Prespacing mode is when the carriage
control character is in column one of the formatted output.

Terminals and Line Printers 

When the file is a terminal or line printer, the device is set into
prespacing mode by performing an FWRITE of length zero with carriage
control option of 101 octal.  Because the carriage control is immediately
executed on these devices, the control code does not have to be actually
written as data to the file.

Disk Files 

If a carriage control disk file is opened and found to be empty, the I/O
library writes the carriage control option of 101 octal (ASCII "A") into
the file.  This allows the file to be later copied to a CCTL device and
still retain the carriage control.  The I/O library performs an FWRITE of
one byte length to embed the prespacing code.  For example, the following
statement is valid:

     WRITE(12,'("A")')

FILE Equation 

If you want to create a CCTL file on a unit other than FTN06, you must
provide a file equation for the opened file that includes the CCTL
characteristic.  A CCTL FILE command for a file that already exists
without carriage control in the file label is overridden by the existing
file's characteristics.  For example, the equation

     :FILE outfile; CCTL

with the FORTRAN 77 statements

            OPEN(16, FILE='outfile')

            WRITE(16,100) " This will be written at the top of a page."
        100 FORMAT ('1', A)

causes the output to be written to the disk file outfile with carriage
control preserved.  When the file is copied to a carriage control output
device, the output line is printed at the top of a page.



MPE/iX 5.0 Documentation