include files and long fixed form lines
- From: robert.corbett@xxxxxxx
- Date: 15 Mar 2006 19:43:13 -0800
An interesting problem came up recently. Note 3.10 of the
Fortran 2003 standard describes a way to write Fortran
include files so that they can be used with either free form
or fixed form source. When a line is to be continued, an
ampersand is placed in column 73 or beyond of the line
being continued, and another ampersand is placed in the
sixth column of the continuation line. That works with
most compilers. Technically, it need not work, since a
compiler is not required to accept lines longer (or shorter)
than 72 characters in fixed form source, but in practice it
works.
The problem is that many compilers include options to allow
lines longer than 72 characters in fixed form. When those
options are used, the ampersands at the end ot the lines
being continued can cause syntax errors. That makes
include files written using the scheme described in
Note 3.10 less universal than one might hope.
A possible 99% solution is to disregard an ampersand at the
end of a line that is longer than 72 characters unless it is in a
character context. What do you think of that idea?
Bob Corbett
.
- Follow-Ups:
- Re: include files and long fixed form lines
- From: robin
- Re: include files and long fixed form lines
- From: Ben Hetland
- Re: include files and long fixed form lines
- From: Joe Krahn
- Re: include files and long fixed form lines
- Prev by Date: Re: Coding guidelines question
- Next by Date: contour map of 3-D subsurface resistivity distribution
- Previous by thread: generating a random permutation
- Next by thread: Re: include files and long fixed form lines
- Index(es):
Relevant Pages
|
|