



Carriage-Control and Printing Whenever formatted output is sent to a "printer", the first character of every record is removed and used to control the vertical spacing. This carriage-control character must be one of the four listed in the the table below.
|
WRITE(LP, 55) NUMBER, 'Report and Accounts'
55 FORMAT('1PAGE', I4, /, '0', A)
|
To be on the safe side you should always provide an explicit carriage-control
character at the start of each format specification and after each slash. Special care is
needed in formats which use forced reversion. Normal single spacing is obtained with
a blank, conveniently produced by the 1X edit descriptor. If you forget and
accidentally print a number at the start of each record with a leading digit 1 then
each record will start a new page.
The effect of + as a carriage-control character would be more useful if its
effects were more predictable. Some devices over-print the previous record
(allowing the formation of composite characters like ), others append to it,
and some (including many visual display terminals) erase what was there
before. In portable software there is no alternative but to ignore the + case
altogether.
Standard Fortran can only use the four carriage-control characters listed in the
table but many systems use other symbols for special formatting purposes, such as
setting vertical spacing, changing fonts, and so on. One extension which is widely
available is the use of the currency symbol $ to suppress carriage-return at the end of
the line. This can be useful when producing terminal prompts as it allows the reply
to be entered on the same line. There is, unfortunately, no way of doing this in
Standard Fortran.
The rules for list-directed output ensure that the lines are single-spaced by requiring at least one blank at the start of every record.