24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Language</strong> <strong>Reference</strong><br />

Example:<br />

PRINT ’(’’THE NUMBER<br />

$ ’’12345’’)’<br />

END<br />

IS AN INTEGER’’,TL19,<br />

The output produced is<br />

THE NUMBER 12345 IS AN INTEGER<br />

11.7.4 Slash Editing<br />

The slash edit descriptor indicates the end of data transfer on the current record. On input from a record<br />

connected for sequential access, the remaining characters in the record are skipped and the file is positioned<br />

to the start of the next record. Note that entire records may be skipped. On output, a new record is created<br />

and becomes the last and current record of the file. Note that a record with no characters can be written. If<br />

the file is an internal file or a direct access file, the record is filled with blanks.<br />

For a file connected for direct access, the current record number is increased by one and the file is<br />

positioned at the beginning of that record.<br />

11.7.5 Colon Editing<br />

The colon edit descriptor terminates processing of the format specification if there are no more items in the<br />

I/O list. If there are items remaining in the I/O list, the colon edit descriptor has no effect.<br />

11.7.6 S, SP and SS Editing<br />

The S, SP and SS edit descriptors control optional plus characters in numeric output fields. They only<br />

effect the I, F, E, D and G edit descriptors during output and have no effect on input. The <strong>FORTRAN</strong> <strong>77</strong><br />

standard specifies that before processing a format specification, the appearance of a plus sign in numeric<br />

output fields is optional and is determined by the processor. <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> does not<br />

produce plus signs in numeric output fields. When an SP edit descriptor is encountered, a plus sign is<br />

produced in any subsequent position that optionally contains a plus sign. When as SS edit descriptor is<br />

encountered, a plus sign is not produced in any subsequent position that optionally contains a plus sign. If<br />

an S edit descriptor is encountered, the option is returned to the processor.<br />

Example:<br />

PRINT ’(1H)’,1,2,3<br />

END<br />

The output produced by the PRINT statement in the previous example is:<br />

< 1 +2 3><br />

11.7.7 P Editing<br />

The form of a P edit descriptor is kP where k is an optionally signed integer constant called the scale<br />

factor. The value of the scale factor is zero at the beginning of each I/O statement. The scale factor applies<br />

to all subsequent F, E, D and G edit descriptors until another scale factor is encountered. The scale factor<br />

affects editing in the following way.<br />

230 Editing

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

Saved successfully!

Ooh no, something went wrong!