Intel fortran-80 List·Directed Formatting, List-Directed Input, Paint 25, Pname, Format A20, $

Models: fortran-80

1 130
Download 130 pages 742 b
Page 82
Image 82

Input/Output

FORTRAN-SO

scanner encounters a dollarsign at the end of a format specification list, format con;. trol terminates without positioning the file to the beginning of the next record. The donar sign .edit descriptor has no effect on direct~accessfil¢s.

Example:

PAINT 25, PNAME

25FORMAT (A20, $)

6.4.4List·Directed Formatting

I

List-directed formatting is indicated by specifying an asterisk (*) in the format specifier of a data-transfer 110 statement's control list (section 6.3.1.1.2). It allows free form input and output, which is especially helpful if the 110 device is a console terminal. No FORMAT statement is required as all necessary formatting is done for the programmer.

A list-formatted file consists of a string of values and value separators. Each value is either a constant, a null value, or a constant or null value prefixed by a repeat specification in the form:

r*c

r*

The first form is equivalent to 'r' successive appearances of the constant 'c;' the se- cond is equivalent to 'r' null values. A null value can also be specified as no characters between value separators or no characters preceding the first value separator in a record. The null value is not produced by list-directed output.

Value separators can be a comma, slash, or one or more blanks between constants or following the last constant in a record. The slash separator is not produced on out- put. When encountered during list-directed input, it terminates execution of the in- put statement after assignment of the previous value. If the 110 list contains addi- tional items, they are effectively assigned null values.

Any sequence of blanks is treated as a single blank except when it appears within a character constant. An end-of-record has the same effect as a blank.

6.4.4.1 List-Directed Input

Input forms acceptable to format specifications for a given type are acceptable for list-directed formatting with a few exceptions. Blanks are never treated as zeros, and may not be embedded in constants (except character constants).

An input list item of type real is assumed to have no fractional part in its input form unless a decimal point appears within the field. An input list item of type logical must not include either slashes or commas in its input form.

An input list item of type character consists, in its input form, of a nonempty string of characters enclosed in apostrophes. Character constants can be continued from the end of one record to the beginning of the next. Though the end of a record nor- mally has the effect of a blank in list-directed formatting, a blank is not inserted into the character constant in this case. Character constants are transferred left-justified and are truncated on the right if their length exceeds the width of the input list item.

A null value has no effect on a corresponding input list item. The item retains its previous value or remains undefined, depending on its status before the null value was encountered.

6-22

Page 82
Image 82
Intel fortran-80 manual List·Directed Formatting, List-Directed Input, Paint 25, Pname, Format A20, $