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 />

1.3 Source Program Format<br />

<strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> supports one source program format. A <strong>FORTRAN</strong> program is composed of<br />

lines. There are three types of lines; the comment line, the initial line, and the continuation line.<br />

1.3.1 Comment Line<br />

Comment lines are denoted by placing a "C" or "*" in column one of the line. <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong><br />

<strong>77</strong> also allows the use of a lowercase "c" as a comment indicator. Blank lines are treated as comment lines.<br />

Comment lines may be placed anywhere in the program source (i.e., they may appear before a <strong>FORTRAN</strong><br />

statement, they may be intermingled with continuation lines, or they may appear after a statement). There<br />

is no restriction on the number of comment lines. Comment lines may contain any characters from the<br />

processor character set.<br />

<strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> allows end-of-line comments. If a "!" character appears in column 1 or<br />

anywhere in the statement portion of a source line, the remainder of that line is treated as a comment unless<br />

the "!" appears inside quotation marks or in column 6.<br />

1.3.2 Debug Line (Extension)<br />

Debug lines are denoted by placing a "D" or "d" in column one of the line. Debug lines contain<br />

<strong>FORTRAN</strong> statements. There is no restriction on the number of debug lines. Normally, the <strong>FORTRAN</strong><br />

statements on debug lines are ignored by the compiler. See the User’s Guide for information on activating<br />

debug statements.<br />

1.3.3 Initial Line<br />

An initial line is the first line of a <strong>FORTRAN</strong> statement. Column 6 of this line must be blank or contain the<br />

digit "0". A comment line can never be an initial line. Columns 1 through 5 of an initial line may contain a<br />

statement label. Statement labels are composed entirely of digits. The statement label may be thought of<br />

as an integral number and, as such, leading 0 digits are not significant. For example, the label composed of<br />

the digits "00123" is the same as the label "123". The same label may not identify more than one statement<br />

in a program unit. A program unit is a series of comment lines and <strong>FORTRAN</strong> statements ending in an<br />

END statement. The body of the <strong>FORTRAN</strong> statement is entered starting in column 7 and stopping at<br />

column 72. Column 73 and on is called the sequence field and is ignored by the compiler.<br />

1.3.4 Continuation Line<br />

A statement may be continued on a new line. A continuation character is placed in column 6. The<br />

continuation character may not be a blank character or a "0" character. <strong>FORTRAN</strong> <strong>77</strong> requires that the<br />

continuation character be selected from the <strong>FORTRAN</strong> character set but <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong><br />

allows any character from the processor’s character set. The statement number field must be blank. The<br />

previous statement is continued on the new line, starting in column 7 and continuing to column 72. Under<br />

the control of a compiler option, <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> permits the source statement to extend to<br />

column 132.<br />

4 Source Program Format

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

Saved successfully!

Ooh no, something went wrong!