include files and long fixed form lines



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

.



Relevant Pages

  • Re: include files and long fixed form lines
    ... and another ampersand is placed in the ... than 72 characters in fixed form source, ... The problem is that many compilers include options to allow ... lines longer than 72 characters in fixed form. ...
    (comp.lang.fortran)
  • Re: include files and long fixed form lines
    ... sixth column of the continuation line. ... than 72 characters in fixed form source, ... lines longer than 72 characters in fixed form. ...
    (comp.lang.fortran)
  • Re: Blakes 7 on Sky
    ... Yes the other characters were auxiliaries but these 3 were ... option much more likely than a "Continuation" which would take a whole lot ... By some Technical B.S and tomfoolery ORAC is now voiced by PAUL DARROW, ... Gradually a complement of 6 is assembled - no explanation proferred.(crew ...
    (rec.arts.drwho)
  • Re: String returned from TMenuItem.Caption
    ... There is no Ampersand present in the Caption value.. ... Why do you cast the string property to PChar, only to assign it back to ... I wouldn't use the menu's caption as a place to store program data. ... Beware that Uppercase only handles ASCII characters. ...
    (alt.comp.lang.borland-delphi)
  • Re: Enhanced JCL processor? (and maybe a few other thoughts)
    ... line is a continuation of this line. ... The first three characters of the ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)