# 10.6 PRINT and TYPE Statements

The PRINT statement is a data transfer output statement. TYPE is a synonym for PRINT. All forms and rules for the PRINT statement also apply to the TYPE statement.

The PRINT statement is the same as a formatted, sequential WRITE statement, except that the PRINT statement must never transfer data to user-specified I/O units.

A PRINT statement takes one of the following forms:

  Formatted:
  PRINT form [, io-list]
  Formatted - List-Directed:
  PRINT * [, io-list]
  Formatted - Namelist:
  PRINT nml
  form
  Is the nonkeyword form of a format specifier (no FMT=).
  io-list
  Is an I/O list.
  *
  Is the format specifier indicating list-directed formatting.
  nml
  Is the nonkeyword form of a namelist specifier (no NML=) indicating namelist formatting.

Examples

In the following example, one record (containing four fields of data) is printed to the implicit output device:

          CHARACTER*16 NAME, JOB
          PRINT 400, NAME, JOB
    400   FORMAT ('NAME=', A, 'JOB=', A)

For More Information:

- On formatted, sequential WRITE statements, see Section 10.5.1.1.
- On formatted data and data transfers, see your user manual or programmer's guide.
- On list-directed output, see Section 10.5.1.2.
- On namelist output, see Section 10.5.1.3.
- On I/O lists, see Section 10.2.2.

Previous Page Next Page Table of Contents