[comp.os.vms] RECORD ATTRIBUTE PROBLEMS.

JWMANLY@AMHERST.BITNET.UUCP (09/17/87)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hello everyone.

I am attempting to write a program which will take as input a file with fortran
carraige control (eventually it will take a file with any carriage control) ,
and produce an equivalent file with no carriage control. Equivalent in this
sense is taken to mean that both files should yield the same sequence of
characters (including control characters) when TYPEed to the screen or printed.

The procedure, at first glance, does not seem to hard.  For each record of the
input file, one simply looks at the first character, strips it off, and appends
the proper prefix and postfix sequences.  For example, if the record looked
like " HELLO" this should become "<LF>HELLO<CR>".  If the record looked like
"0HELLO" the output record should be "<LF><LF>HELLO<CR>".  No problem.

EXCEPT THAT IT DOESN'T SEEM TO WORK THIS WAY.

In particular, when a fortran file is typed on a screen, what control
characters are issued seems to depend on what characters have already been
printed.  For example, a fortran format file with the following records:

       "$QUESTION"
       " ANSWER"

Should produce the following characters:  "<LF>QUESTION<LF>ANSWER<CR>" However,
if you copy this to a terminal in "display control" mode, you see:

        "<LF>QUESTION<CR><LF>ANSWER<CR>".   Why is that extra <CR> in there?

After much experimentation I came to the following conclustion about the
behavior: Any time a write operation with fortran carriage control other than
"<NULL>" or "+" is sent to a terminal, if the character most recently printed
was something other than a <CR>, a <CR> is inserted.  Thus, in the above
example, a <CR> was added before the "<LF>ANSWER<CR>" because the last
character written was an "N" not a "<CR>"

The effect of this is that write operations, except those done with NULL or "+"
carriage control, always begin at the left margin.

Has anybody seen this before?  Does anybody have a better theory as to the
symptoms?  DOES ANYBODY KNOW WHY THIS IS HAPPENING?

BTW, DEC must know about this, becuase the printer driver yields the "correct"
result when merging records together in a print job.  So, the printer driver
does manage to make the print job look just like it was copied to a screen.

BITNET: JWMANLY@AMHERST                   John W. Manly
PHONE:  (413)-542-2526                    System Manager
                                          Amherst College

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

reh@ccd700.UUCP (09/23/87)

In article <8709190918.AA00746@ucbvax.Berkeley.EDU>, JWMANLY@AMHERST.BITNET ("John W. Manly") writes:
> printed.  For example, a fortran format file with the following records:
>        "$QUESTION"
>        " ANSWER"
>Should produce the following characters:  "<LF>QUESTION<LF>ANSWER<CR>" However,
> if you copy this to a terminal in "display control" mode, you see:
>         "<LF>QUESTION<CR><LF>ANSWER<CR>".   Why is that extra <CR> in there?
> Has anybody seen this before?  Does anybody have a better theory as to the
> symptoms?  DOES ANYBODY KNOW WHY THIS IS HAPPENING?
> BITNET: JWMANLY@AMHERST                   John W. Manly

The way I read the manual, the conversion is:
" line" means <LF>line<CR>
"0line" means <LF><LF>line<CR>   (or <LF><CR><LF>line<CR> ?)
"1line" means <FF>line<CR>
"+line" means line<CR>
and any other character (or a zero length line) is treated as a space.
Therefore: "$QUESTION"
	   " ANSWER"
converts to <LF>QUESTION<CR><LF>ANSWER<CR>
I hope that this helps.
......................................................................
Bob Harold                      313-845-5404   
Ford Motor Co., DPTC room B-206 ...!ihnp4!mibte!ccd700!eed090!bob
17000 Rotunda Drive             Disclaimer: The views expressed might
Dearborn, MI 48121-6010         not be those of my employer or myself
Have questions about life?  Read the original design manual - the Bible.
......................................................................