FORTRAN Reference Manual

Compiler Directives
FORTRAN Reference Manual528615-001
10-10
COLUMNS Compiler Directive
Considerations
The COLUMNS directive can appear on the FORTRAN command line following
the semicolon after the object file name. It can also appear anywhere in a source
input file. A compilation can have any number of COLUMNS directives.
When source files contain a COLUMNS directive, it must be the first or only
directive on a line, and it must appear before the first SECTION directive if there
are SECTION directives in the file.
Use of the COLUMNS directive
The COLUMNS value in effect at any given time depends on the context, as
follows:
°
At the beginning of the main input file, the COLUMNS value is set by the last
COLUMNS directive on the FORTRAN command line. If the FORTRAN
command line has no COLUMNS directive, the COLUMNS value is 132.
°
A file read in by a SOURCE directive initially assumes the current COLUMNS
value of the file that contains the SOURCE directive.
°
At the beginning of each section (of the main input file or of a file read in by a
SOURCE directive), the current COLUMNS value is set by the last COLUMNS
directive before a SECTION directive.
(The COLUMNS directive is the only exception to the rule that FORTRAN
ignores all directives or statements appearing outside a section specified in a
SOURCE directive.)
°
Within each section, the current COLUMNS value is changed by any
COLUMNS directive included in the section. Each COLUMNS directive is in
effect only until the next COLUMNS or SECTION directive, the end of the
SOURCE directive, or the end of the file, whichever comes first.
°
When a SOURCE directive is completed—that is, when all sections named in
the SOURCE directive have been read or when the end of the file is reached,
whichever comes first—the current COLUMNS value is restored to what it was
when the SOURCE directive was encountered.
°
For cases not specified in this list, the current COLUMNS value is the value set
by the most recently processed COLUMNS directive.
If a source file has comments (such as source line identification) at the ends of the
lines, place a COLUMNS directive at the beginning of the file.
If a source file has no comments at the ends of the lines, specify COLUMNS 132 at
the beginning of the file to prevent lines from being truncated if this file is read in by
a file that has a smaller COLUMNS value.
The ANSI compiler directive is equivalent to COLUMNS 72, but with the following
differences: