Discussion:
Feed control
(too old to reply)
db
2024-04-03 12:43:38 UTC
Permalink
When I learned Fortran many years ago, the first
character in a line to be printed (or later,
displayed) controlled line or page feed. A blank
produced a new line, a "1" a new page. We used these
to control what happened.

These days, this doesn't seem to be the case, so
in a sense, Fortran is no longer backward
compatible in this one sense. Or is it?

As an aside, back in the 1970's, working on an
IBM 360, where we handed in a stack of punch cards
to be run and got the output some time later as a
print-out, I once accidentally put a "c" in as the
first character in a line of output, and this caused
an endless paper feed, until the operator stopped
it. I got a stern note never to run that program
again, on top of a thick stack of blank paper.
Steve Lionel
2024-04-03 15:09:06 UTC
Permalink
Post by db
When I learned Fortran many years ago, the first
character in a line to be printed (or later,
displayed) controlled line or page feed. A blank
produced a new line, a "1" a new page. We used these
to control what happened.
These days, this doesn't seem to be the case, so
in a sense, Fortran is no longer backward
compatible in this one sense. Or is it?
Fortran character control in formatted I/O is a "deleted feature" and is
no longer part of the standard. As is typical for deleted features, it
is still supported by many compilers, though you may have to ask for it.
It also perseveres in such things as list-directed output specifying
that the output record starts with a blank.

Fortran carriage control is an artifact of the line printer era - I
remember punching carriage control tapes in the 70s. In addition, many
of today's output devices and environments don't support it.

By definition, deleted features mean that programs that conform to a
previous standard no longer conform to the current one. In nearly all
cases, these are features that are poor practice and are replaced by
better ones, though compilers almost always continue to support them.
--
Steve Lionel
ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: https://stevelionel.com/drfortran
WG5: https://wg5-fortran.org
Gary Scott
2024-04-03 16:22:35 UTC
Permalink
Post by db
When I learned Fortran many years ago, the first
character in a line to be printed (or later,
displayed) controlled line or page feed. A blank
produced a new line, a "1" a new page. We used these
to control what happened.
These days, this doesn't seem to be the case, so
in a sense, Fortran is no longer backward
compatible in this one sense. Or is it?
This was always, and remains device dependent.
Post by db
As an aside, back in the 1970's, working on an
IBM 360, where we handed in a stack of punch cards
to be run and got the output some time later as a
print-out, I once accidentally put a "c" in as the
first character in a line of output, and this caused
an endless paper feed, until the operator stopped
it. I got a stern note never to run that program
again, on top of a thick stack of blank paper.
Lynn McGuire
2024-04-03 20:47:13 UTC
Permalink
Post by db
When I learned Fortran many years ago, the first
character in a line to be printed (or later,
displayed) controlled line or page feed. A blank
produced a new line, a "1" a new page. We used these
to control what happened.
These days, this doesn't seem to be the case, so
in a sense, Fortran is no longer backward
compatible in this one sense. Or is it?
As an aside, back in the 1970's, working on an
IBM 360, where we handed in a stack of punch cards
to be run and got the output some time later as a
print-out, I once accidentally put a "c" in as the
first character in a line of output, and this caused
an endless paper feed, until the operator stopped
it. I got a stern note never to run that program
again, on top of a thick stack of blank paper.
I use the following in Watcom F77 Fortran as we still use Fortran
carriage control in column 1 in all of our main write statements, about
40,000 of them in our code.

C open the output file
OPEN (UNIT = oufile,
* FILE = OUPATH,
* ACTION = 'WRITE',
* ACCESS = 'SEQUENTIAL',
* STATUS = 'UNKNOWN',
! watcom uses yes
* CARRIAGECONTROL = 'YES',
! gfortran uses 'FORTRAN'
! * CARRIAGECONTROL = 'FORTRAN',
! does not work on gfortran
! * BLOCKSIZE = 80,
* FORM = 'FORMATTED',
* IOSTAT = OPERR,
* ERR = 400)

Lynn
Lawrence D'Oliveiro
2024-04-03 22:38:00 UTC
Permalink
... we still use Fortran carriage control in column 1 in all of our main
write statements, about 40,000 of them in our code.
Never too soon to start fixing them. Do it one at a time.
Lynn McGuire
2024-04-04 00:20:30 UTC
Permalink
Post by Lawrence D'Oliveiro
... we still use Fortran carriage control in column 1 in all of our main
write statements, about 40,000 of them in our code.
Never too soon to start fixing them. Do it one at a time.
Gotta do them all at once since the carriage control is controlled by
the OPEN statement.

Lynn
Lawrence D'Oliveiro
2024-04-04 20:33:06 UTC
Permalink
Post by Lynn McGuire
Post by Lawrence D'Oliveiro
... we still use Fortran carriage control in column 1 in all of our
main write statements, about 40,000 of them in our code.
Never too soon to start fixing them. Do it one at a time.
Gotta do them all at once since the carriage control is controlled by
the OPEN statement.
There is a way to do it: open a second output file, without the Fortran
carriage control setting. Send both outputs to pipes read by a separate
filter process that interleaves the lines back into the real output file.

Now you can go through gradually, changing those output statements one by
one to write to the second file. Once they are all done, you can get rid
of the first file and the filter process, and resume output directly to
the output file.
Jeff Ryman
2024-04-03 23:32:06 UTC
Permalink
On Wed, 3 Apr 2024 12:43:38 -0000 (UTC), db
Post by db
When I learned Fortran many years ago, the first
character in a line to be printed (or later,
displayed) controlled line or page feed. A blank
produced a new line, a "1" a new page. We used these
to control what happened.
These days, this doesn't seem to be the case, so
in a sense, Fortran is no longer backward
compatible in this one sense. Or is it?
As an aside, back in the 1970's, working on an
IBM 360, where we handed in a stack of punch cards
to be run and got the output some time later as a
print-out, I once accidentally put a "c" in as the
first character in a line of output, and this caused
an endless paper feed, until the operator stopped
it. I got a stern note never to run that program
again, on top of a thick stack of blank paper.
The *nix command asa will remove the first character
of every line and output the rest of the line to standard
output as follows:
1) space - output the rest of the line without change
2) 0 - Replace by a newline followed ty the rest of the input line
3) 1 - Replace by a newpage followed by the rest of the input line
4) + - Replace by a control to return to the first column of the
previous line, where the rest of the input line is printed.

usage is: asa input_file > output_file

This allows the output file to be printed as originally intended.

Someplace I have the source to a Fortran program I wrote
for DOS in the 1990s to perform the same function.
Dr. What
2024-04-04 13:52:09 UTC
Permalink
-=> Gary Scott wrote to All <=-
Post by db
When I learned Fortran many years ago, the first
character in a line to be printed (or later,
displayed) controlled line or page feed. A blank
produced a new line, a "1" a new page. We used these
to control what happened.
These days, this doesn't seem to be the case, so
in a sense, Fortran is no longer backward
compatible in this one sense. Or is it?
GS> This was always, and remains device dependent.

That's not completely true.

Using MS-FORTRAN on my vintage computers, I always have to start my
FORMATs
with "1X". If I fail to do that, the output, even to the screen, chops
off
that first character.


... Epitaph on a gravestone: Cheerio, see you soon.
___ MultiMail/Linux v0.52
Gary Scott
2024-04-04 16:43:43 UTC
Permalink
Post by Dr. What
-=> Gary Scott wrote to All <=-
Post by db
When I learned Fortran many years ago, the first
character in a line to be printed (or later,
displayed) controlled line or page feed. A blank
produced a new line, a "1" a new page. We used these
to control what happened.
These days, this doesn't seem to be the case, so
in a sense, Fortran is no longer backward
compatible in this one sense. Or is it?
GS> This was always, and remains device dependent.
That's not completely true.
Using MS-FORTRAN on my vintage computers, I always have to start my
FORMATs
with "1X". If I fail to do that, the output, even to the screen, chops
off
that first character.
Hmmm. I'd say that's precisely what "device dependent" means. Although
some behavior in MS Fortran was just bugs.
Post by Dr. What
... Epitaph on a gravestone: Cheerio, see you soon.
___ MultiMail/Linux v0.52
R Daneel Olivaw
2024-04-04 17:09:40 UTC
Permalink
Post by Dr. What
-=> Gary Scott wrote to All <=-
  > When I learned Fortran many years ago, the first
  > character in a line to be printed (or later,
  > displayed) controlled line or page feed. A blank
  > produced a new line, a "1" a new page. We used these
  > to control what happened.
  >
  > These days, this doesn't seem to be the case, so
  > in a sense, Fortran is no longer backward
  > compatible in this one sense. Or is it?
  >
  GS> This was always, and remains device dependent.
That's not completely true.
Using MS-FORTRAN on my vintage computers, I always have to start my
FORMATs
with "1X".  If I fail to do that, the output, even to the screen, chops
off
that first character.
Hmmm.  I'd say that's precisely what "device dependent" means.  Although
some behavior in MS Fortran was just bugs.
Post by Dr. What
... Epitaph on a gravestone: Cheerio, see you soon.
___ MultiMail/Linux v0.52
Not at all, the 1X means that the line-feed character is a space. A "+"
there would probably overlay whatever had previously been printed to
that line with something new.
I have used several different compilers on several different
architectures over the years (the newest adhered to the F77 standard)
and the meaning of the first character on a line was common to all of them.
Gary Scott
2024-04-05 01:55:11 UTC
Permalink
Post by Dr. What
-=> Gary Scott wrote to All <=-
  > When I learned Fortran many years ago, the first
  > character in a line to be printed (or later,
  > displayed) controlled line or page feed. A blank
  > produced a new line, a "1" a new page. We used these
  > to control what happened.
  >
  > These days, this doesn't seem to be the case, so
  > in a sense, Fortran is no longer backward
  > compatible in this one sense. Or is it?
  >
  GS> This was always, and remains device dependent.
That's not completely true.
Using MS-FORTRAN on my vintage computers, I always have to start my
FORMATs
with "1X".  If I fail to do that, the output, even to the screen, chops
off
that first character.
Hmmm.  I'd say that's precisely what "device dependent" means.
Although some behavior in MS Fortran was just bugs.
Post by Dr. What
... Epitaph on a gravestone: Cheerio, see you soon.
___ MultiMail/Linux v0.52
Not at all, the 1X means that the line-feed character is a space.  A "+"
there would probably overlay whatever had previously been printed to
that line with something new.
I have used several different compilers on several different
architectures over the years (the newest adhered to the F77 standard)
and the meaning of the first character on a line was common to all of them.
There were very many different devices that had different meanings for
various control characters. There were also devices based on EBCDIC
with completely different character "values" used to achieve a similar
effect. There were also many devices that required multi-character
(/binary) control sequences. Just because there was a frequent
convention on Windows or Linux doesn't mean it was universal.
Lawrence D'Oliveiro
2024-04-05 02:38:53 UTC
Permalink
Post by Gary Scott
Just because there was a frequent
convention on Windows or Linux doesn't mean it was universal.
The conventions predated those platforms by several decades.

Loading...