Re: Outputting Formatted data to file

From: Richard Maine (nospam_at_see.signature)
Date: 10/22/04


Date: Fri, 22 Oct 2004 10:50:54 -0700

spacha5@yahoo.com (Seth Pacha) writes:

> I have some code that outputs data to a file that is not working as
> intended. It is older code in a fixed_format style. The code does
> not print out to a new page or double spaced as intended. Is there
> some compiler option I might need?

The code is using carriage control. That is an old and problematic feature.
It is no longer in the f2003 standard at all, though it's prior
"standardization" didn't actually achieve much. One of the issues that kept
it from achieving much was that it applies only to files meant for "printing".
There was and is no standard way to define or inquire about what files are
for printing. That is completely compiler dependent (to the extent that
the compiler can, and many do, say that no files are for printing).

Any more, this mostly isn't a Fortran issue at all. It is an issue of
printers and printer drivers, independent of programming languages.
Actually, it always was such an issue. The original "Fortran" carriage
control stuff was just material copied from the ASA printer standard of
the day... but you probably won't run into printers today meeting that
old standard. They still exist, I think, in mainframe data centers, but
you probably won't run into them.

Note that there isn't a concept of a "page" in most text file formats.
All you can do is something that will cause a new page when sent to a printer
or screen. Blank lines are easy enough.

Printers aren't terribly standardized these days, but many of them will
accept an ASCII control-L (form feed) as a new page. Aand text-to-postscript
drivers for postscript printers often translate the control-L appropriately.

There is a program around on some systems. The usual name escapes me at the
moment. Perhaps asa, or something begining with f (not very helpful, I know)
that will comvert the old asa stuff into something more likely to print
as desired. You can run it as a post-processor.

Or modify the code to print out blank lines for double-spacing and
control L for new page. (control-L is achar(12)).

-- 
Richard Maine
email: my last name at domain
domain: summertriangle dot net


Relevant Pages

  • Re: Which compiler
    ... > the first character of the record when using list-directed output? ... line printers controlled by a loop of paper tape-- ... The standard required the blank in column one so that the ... control character in column one. ...
    (comp.lang.fortran)
  • Re: Airport cards for G3 iMac - is someone joking on price?
    ... expensive parallel only laser printers and big industrial laser ... having a simple parallel interface. ... USB to serial adaptor, though. ... modern Windows box that didn't come with parallel as standard. ...
    (uk.comp.sys.mac)
  • Re: Why GCC does warn me when I using gets() function for accessing file
    ... specification/programmer/language's control. ... standard suggests. ... the input, and as longstanding existing practice, ... needed for this reason. ...
    (comp.lang.c)
  • Re: real time linux
    ... >> nature this type of system is open loop. ... positional command generator in the control. ... > STEP is a standard so it is possible to have certain expectations ... outside of the STEP standard and the ability to edit and compile on the ...
    (alt.machines.cnc)
  • Re: General Graphics question
    ... Standard: what you see is what you get. ... You use a standard control and override the painting ... Chris Tacke, Embedded MVP ... by the Windows graphics libraries!!!! ...
    (microsoft.public.windowsce.embedded.vc)

Loading