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

Create successful ePaper yourself

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

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

3. An input item of type complex or double precision complex must consist of a left parenthesis<br />

followed by two numeric input fields separated by a comma and followed by a right parenthesis.<br />

The numeric input fields may be preceded or followed by blanks. The end of record can only<br />

appear between the first numeric field and the comma or between the comma and the second<br />

numeric field. Note that a null value must not be used as the real or imaginary part but may<br />

represent the entire complex constant.<br />

4. An input item of type logical must not include either a slash or a comma among the optional<br />

characters allowed in L editing.<br />

5. An input item of type character consists of a non-empty string of characters enclosed in<br />

apostrophes. Apostrophes in character constants are represented by two consecutive apostrophes<br />

without a blank or end of record separating them. Character constants may span records. If this<br />

is the case, the end of record does cause a blanks to be inserted into the character constant. Note<br />

that a comma or slash in a character constant is not a value separator. A character input field is<br />

assigned to a character input item as though it were a character assignment.<br />

11.9.2 List-Directed Output<br />

The form of the output field produced by list-directed output is similar to the form required by list-directed<br />

input. The output of a character constant does not include the enclosing quotes and an apostrophe in a<br />

character constant is output as a single apostrophe. The values are separated by one or more blanks. When<br />

printed, each record will start with a blank if the file is a carriage-control oriented file. For example, the<br />

source listing file produced by <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> is such a file.<br />

11.10 Namelist-Directed Formatting (Extension)<br />

The READ, WRITE, and PRINT statements may be used to transmit data between a file and the variables<br />

specified in a NAMELIST statement.<br />

Example:<br />

CHARACTER*20 NAME<br />

CHARACTER*20 STREET<br />

CHARACTER*15 CITY<br />

CHARACTER*20 STATE<br />

CHARACTER*20 COUNTRY<br />

CHARACTER*10 ZIP_CODE<br />

INTEGER AGE<br />

INTEGER MARKS(10)<br />

NAMELIST /nl/ NAME, STREET, CITY, STATE,<br />

+ COUNTRY, ZIP_CODE, AGE, MARKS<br />

.<br />

.<br />

.<br />

READ( un, nl )<br />

READ( UNIT=un, FMT=nl )<br />

READ nl<br />

WRITE( un, nl )<br />

WRITE( UNIT=un, FMT=nl )<br />

PRINT nl<br />

240 Namelist-Directed Formatting (Extension)

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

Saved successfully!

Ooh no, something went wrong!