On 6/18/19 10:31 AM, spectrum wrote:
> However, the output obtained with asterisk always has one additional space
> at the beginning of each line, which makes the output less neat...
Before the (modern) ANSI standards organization (formed from other
organizations in 1969) where was ASA (American Standards Association).
This is not a government agency, it is a private non-profit
organization. They defined a print file format that used the first
character of each line to determine how it should be printed. A blank '
', meant to advance one line before printing. Some of the other
possibilities were '+' which meant to not advance at all but to
overprint the previous line with the new one, '0' advance two lines, '-'
advance three lines, and '1' advance to the next page. These characters
were not printed in the output, they just controlled the printer carriage.
The early Fortran versions (starting with II, I think) used that
standard convention. In order to avoid anything special or unexpected on
list-directed i/o, it always wrote the leading space. It was not
uncommon in the 1960s and even the 1970s to print a file from a fortran
program and instead of getting a few pages of output back, you would get
a stack of paper an inch thick. The reason is that you would forget to
add that leading space before printing, and the various combinations of
numbers and '-' signs in the first column would cause the paper to spin
through the printer, mostly blank, with only a few lines per page.
With this printer convention, list directed i/o would have been
practically useless without that leading space. This behavior was
standardized in the fortran standard, and it apparently has survived
some 50 or 60 years to the present day. It is sometimes called "fortran
carriage control", but that isn't really correct, it is really ASA
carriage control, adopted into fortran.
Many computers have a utility (e.g. asa in unix) that takes such a file
and converts it into ASCII characters. The ASCII convention is to embed
various nonprinting characters (denoted CR, LF, FF, VT) into the file to
control the printer carriage.
$.02 -Ron Shepard