Hello,
I want to create a page form feed with the command “write”.
In the format list I only find the control character “/” for a line feed.
write(*,1) 'Hello'
1 format(A, ?)
Kind Regards
Juergen
Hello,
I want to create a page form feed with the command “write”.
In the format list I only find the control character “/” for a line feed.
write(*,1) 'Hello'
1 format(A, ?)
Kind Regards
Juergen
There are several approaches. It will be interesting to see the various suggestions for this.
One way might be to write the ASCII form feed character to the output file. That character is given by the expression achar(12)
. You could use either list-directed i/o to write this character, or you could write it with an a
format field (as in your code).
If you had asked this question a few decades ago, then there would have been a different answer. Files were assumed to follow ASA conventions (ASA was the predecessor standard to ASCII), and the answer would have been to write a ‘1’ character in the first column of an output line. The printer would then be expected to see that character and to act accordingly. Printers stopped doing this by default in the 1970s and 1980s. To get them to behave correctly for ASA files, there was often a separate conversion step from ASA to ASCII conventions. The utility program that did this conversion was often invoked as
asa infile outfile
This might still be a viable approach, but I think I would try something like the achar(12)
approach first.
Hello,
Thank you very much for the quick answer, this is how the form feed works:
write (*,1) 'Page 1', achar(12)
1 format(A,A1)
Kind Regards
Juergen