Re: Converting fixed-to-free format
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Tue, 14 Mar 2006 01:42:06 -0800
Richard Maine wrote:
(snip)
The standard pointedly does not define what the physical representation
of a line is. The simplest model, and the one many people naturally
assume, is that Fortran's line is represented as a normal text file
line. But the standard doesn't actually say that, and the difference
matters. In particular,
and on some systems there is more than one representation for a normal
text file.
For those of us who used to use 80-column punch cards, we weren't
violating the standard by using those cards. After all, even if you
didn't punch anything in cols 73-80, that still counts as blanks, right?
The presumed physical representation of a line in that era was the first
72 columns of the card (in whatever code you were using), ignoring cols
73-80.
As I understand it, the 704 card reader only read 72 columns. The manual doesn't say what the record format is on tape, but fixed length 72 character records is a good guess.
Likewise, now in the day where most source code is
variable-record-length text files on disk, it is quite reasonable to
interpret the mapping between Fortran's lines and physical
representation to be such that a Fortran line is the first 72 (or 132
for free form) characters of each line, with extra blanks added to get
up to 72 if needed. If you don't adopt some kind of non-trivial
translation, you'll conclude that pretty much nobody writes standard
fixed source form code, because almost nobody carefully pads their
source code files out to exactly 72 characters per record, no more and
no less. Well, maybe in some environments where the editor and/or file
system do it for you, but that is few enough environments that it counts
as "almost nobody" today.
For OS/360 only fixed length 80 character records are allowed. I believe VS Fortran also expects 80 character fixed length records.
As far as I know, everyone except IBM, and even for IBM it is 80 and not 72 characters per record.
-- glen
.
- Follow-Ups:
- Re: Converting fixed-to-free format
- From: John Harper
- Re: Converting fixed-to-free format
- References:
- Re: Converting fixed-to-free format
- From: George N. White III
- Re: Converting fixed-to-free format
- From: Gary L. Scott
- Re: Converting fixed-to-free format
- From: Gordon Sande
- Re: Converting fixed-to-free format
- From: James Giles
- Re: Converting fixed-to-free format
- From: robin
- Re: Converting fixed-to-free format
- From: James Giles
- Re: Converting fixed-to-free format
- From: robin
- Re: Converting fixed-to-free format
- From: James Giles
- Re: Converting fixed-to-free format
- From: glen herrmannsfeldt
- Re: Converting fixed-to-free format
- From: James Giles
- Re: Converting fixed-to-free format
- From: robin
- Re: Converting fixed-to-free format
- From: Brooks Moses
- Re: Converting fixed-to-free format
- From: Richard Maine
- Re: Converting fixed-to-free format
- Prev by Date: Re: Is this ordering procedure dangerous?
- Next by Date: Re: dll fortran for visual basic .net (little bit long data output)
- Previous by thread: Re: Converting fixed-to-free format
- Next by thread: Re: Converting fixed-to-free format
- Index(es):
Relevant Pages
|