02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

I/O formatting<br />

Format specification and I/O data list<br />

Format specification and I/O data list<br />

A formatted I/O statement references each item in an I/O list, and the corresponding format<br />

specification is scanned to find a format descriptor for each item. As long as an item is<br />

matched to an edit descriptor, normal execution continues.<br />

If there are more edit descriptors than list items, format control terminates with the last list<br />

item. If there are fewer edit descriptors than list items, the following three steps are<br />

performed:<br />

1. The current record is terminated.<br />

2. A new record is started.<br />

3. Format control is returned to the format specification based upon the following hierarchy:<br />

232<br />

a. Control returns to the repeat specification for the rightmost group at nested level 1.<br />

For information about nested levels, see “Nested format specifications” on page 231.<br />

b. If no repeat specification exists in the rightmost group at nested level 1, control<br />

returns to the group itself.<br />

c. If there is no group at nested level 1, control returns to the first descriptor in the<br />

format specification.<br />

Table 9-25 provides examples showing how control is returned to the format specification in<br />

different circumstances.<br />

Table 9-25 Format control and nested format specifications<br />

Format specification Control<br />

returns to:<br />

Explanation<br />

(I5,2(3X,I2,(I4))) 2(3X,I2,(I4)) The rightmost group at nested level 1 is<br />

3X,I2,(I4). Control returns to the repeat<br />

specifier for this group.<br />

(F4.1,I2) (F4.1,I2) There is no group at nested level 1. Control<br />

returns to the first descriptor in the format<br />

specification.<br />

(A3,(3X,I2),4X,I4) (3X,I2),4X,I4 Control returns to the group at nested level 1.<br />

Chapter 9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!