Intel fortran-80 manual Formatted Data Transfer, Printing Formatted Records, Format Control

Models: fortran-80

1 130
Download 130 pages 742 b
Page 75
Image 75
6.4.2 Formatted Data Transfer

FORTRAN-80

Input/Output

6.4.2 Formatted Data Transfer

During formatted data transfer, data is transferred with editing between the file and the 110 list. The editing is directed by some kind of format specification. Format specifications can be given:

In FORMAT statements;

As values of character arrays, character variables, or other character expressions;

As Hollerith values assigned to integer, real, or logical arrays.

If the format specifier (section 6.3.1.1.2) in a formatted 110 statement is a character array name, character variable name, or other character expression, the value referenced must contain a valid format specification in its leftmost character posi- tions. The format specification is described below (section 6.4.3). Character data may follow the right parenthesis that ends the format specification with no effect on the format specification itself. The same applies to Hollerith data in an integer, real, or logical array.

6.4.2.1 Printing Formatted Records

If a formatted record is printed on some external listing device, the first character of the record is not printed. It is used instead to indicate vertical spacing. The remain- ing characters of the record are then printed beginning at the left margin.

When this convention is specified, the first character is interpreted as follows:

Character

Vertical Spacing

Blank

One line

o

Two lines

I

Ski p to next page

+

No advance

This-interpretation is requested by the CARRIAGE specifier of the OPEN statement (section 6.2.1.10). If 'car' is specified as 'FORTRAN" the first character is inter- preted as vertical spacing information and is not printed.

6.4.2.2 Format Control

The edit descriptors that make up the format specification list (section 6.4.3) are classified as either repeatable or nonrepeatable.

Both the format specification list and its corresponding 110 list are scanned left to right. One item in the 110 list corresponds to each repeatable edit descriptor. There is no corresponding 110 list item for nonrepeatable edit descriptors, and format control communicates directly with the 110 record. If a repeatable edit descriptor is repeated, say five times, it corresponds to five consecutive I/O list items.

If a format specification list ends before the I/O list, it reverts to its beginning (or to the left parenthesis matching the rightmost right parenthesis if the format specifica- tion contains nested parentheses). Repeat specifications have the same effect as dur- ing the first pass through the format specification list. A new record is begun each time format reversion occurs.

6-15

Page 75
Image 75
Intel fortran-80 manual Formatted Data Transfer, Printing Formatted Records, Format Control