Use edit descriptor $, and space, 0, or 1 for carriage control.
The special edit descriptor $ suppresses the carriage return. @
The action does not depend on the first character of the format. It is used typically for console prompts. For instance, you can use this descriptor to make a typed response follow the output prompt on the same line. This edit descriptor is constrained by the same rules as the colon (:).
* dol1.f The $ edit descriptor with space WRITE ( *, 2 ) 2 FORMAT (' Enter the node number: ', $ ) READ ( *, * ) NODENUM END
Enter the node number: 82
The first character of the format is printed out, in this case, a blank. For an input statement, the $ descriptor is ignored.
The following first-character slew controls and actions are provided:Table 5-4 Carriage Control with Blank, 0, 1, and +
Vertical spacing before printing
To first line of next page
No advance (stdout only, not files)
If the first character of the format is not space, 0, 1, or +, then it is treated as a space, and it is not printed.
The behavior of the slew control character + is: if the character in the first column is +, it is replaced by a control sequence that causes printing to return to the first column of the previous line, where the rest of the input line is printed.
Space, 0, 1, and + work for stdout if piped through asa.
demo% cat slew1.f WRITE( *, '("abcd")') WRITE( *, '(" efg")') The blank single spaces WRITE( *, '("0hij")') The "0" double spaces WRITE( *, '("1klm")') The "1" starts this on a new page WRITE( *, '("+", T5, "nop")') The "+" starts this at col 1 of latest line END demo% f77 -silent slew1.f demo% a.out | asa | lpr demo%
bcd efg hij klmnop This starts on a new page. The + of +nop is obeyed.
demo% cat slew1.out bcd efg hij nop This starts on a new page. The + of +nop is obeyed. demo%
The space, 0, and 1, and + work for a file opened with:
demo% cat slew2.f OPEN( 1,FILE='slew.out',FORM='PRINT' ) WRITE( 1, '("abcd")') WRITE( 1, '("efg")') WRITE( 1, '("0hij")') WRITE( 1, '("1klm")') WRITE( 1, '("+", T5, "nop")') CLOSE( 1, STATUS='KEEP') END demo% f77 -silent slew2.f demo% a.out
The program, slew2.f, produces the file, slew2.out, that is equal to the file, slew1.out, in the example above.
Slew control codes '0', '1', and '+' in column one are in the output file as '\n', '\f', and '\r', respectively.