HP Fortran Programmer's Reference (September 2007)

Language elements
Source format of program file
Chapter 250
Comments
An exclamation mark (!) indicates the beginning of a comment in free source form, except
where it appears in a character context. The compiler considers the rest of the line following
the exclamation mark as part of the comment. Embedding a comment inside program text
within a single source line is not allowed, but it can follow program text on a source line. A
statement on a line with a trailing comment can be continued on subsequent lines.
Statement continuation
A statement can be split over two or more source lines by appending an ampersand character
(&) to each source line except the last. The ampersand must not be within a character
constant.
A statement can occupy up to 40 source lines. As an extension, HP Fortran increases this limit
to 100 source lines. The END statement cannot be split by means of a continuation line.
Comments are not statements and cannot be continued.
The text of the source statement in a continuation line is assumed to resume from column 1.
However, if the first nonblank symbol in the line is an ampersand, the text resumes from the
first column after the ampersand.
Consider the following two statements:
INTEGER marks, total, difference,& ! work variables
mean, average
INTEGER marks, total, difference, mean_& ! work variables
&value, average
The second statement declares the integer variable, mean_value. Any spaces appearing in
the variable name as a result of the continuation would be invalid. This is the reason for the
ampersand character in the continuation line. (Alternatively, value could have been
positioned at column 1.) Using the ampersand character to split lexical tokens and character
constants across source lines is permitted, but not recommended.
Fixed source form
Statements or parts of statements must be written between character columns 7 and 72. Any
text following column 72 is ignored. The +[no]extend_source option extends the statement
to column 254. Columns 1-6 are reserved for special use.
NOTE Programs that depend on the compiler’s ignoring any characters after column
72 will not compile correctly with the +extend_source option.
Multiple statements may appear on the same line, separated by a semicolon (;).