[comp.lang.fortran] WRITE conclusion.

quan@sol.surv.utas.oz (Stephen Quan) (09/14/90)

Hi I'm the original poster of "WRITE don't do that to me!" and I have found
all the comments on this problem very interesting.  Thanks to all who dropped
a line.

Basically, for other readers, my problem was I wanted to suppress CR,LF in
a WRITE operation so I could get the correct control codes to our TEKTRONIX
graphic terminals.

Some of the solutions suggested were :

1. $ or & to suppress CR,LF.
   Either doesn't compile with our F77 PRIMOS compiler.
   We are porting to the SUN soon so, $ is still a possible solution.

2. OPEN (U,FILE='filename',ACCESS='DIRECT',RECL=1).
   Or at least, that's what I think you guys meant?!
   I found that PRIMOS inserted an addition character for every write
   operation.  This was that uncontrollable record character?

   OPEN (U,FORM='UNFORMATTED')
   Couldn't quite get this working, (U = standard output).  I don't
   think it will work with our machine anyhow.

3. BSD UNIX Fortran libraries putc() fputc().  This is exactly the
   thing I'm looking for, but I don't think it is available for all
   FORTRAN platforms, certainly not on ours.

Well I think in the end I'll wrap of with what I decided to go on with :
This time I give the sample code in lower-case, people are beginning to
think I came from the DARK AGES!  (Also thanks to those people who
commented about lowercase/uppercase and their status in the standard too!)

        character buff2*8
        character buff(8)
        equivalence (buff,buff2)

        buff(1) = char(x1)
            :
        buff(8) = char(x8)

        write (*,100) buff2
100     format (a8)

CR or (LF) could have their affects minimized by moving the cursor to some
position on the screen and let the computer gaily output it!  It shouldn't
affect the graphics codes I'm issuing.

Stephen Quan (quan@sol.surv.utas.edu.au)
University of Tasmania,
School of Surveying,
Aussie.

ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) (09/14/90)

In article <quan.653306785@sol>, quan@sol.surv.utas.oz (Stephen Quan) writes:
> Basically, for other readers, my problem was I wanted to suppress CR,LF in
> a WRITE operation so I could get the correct control codes to our TEKTRONIX
> graphic terminals.
...
>    Either doesn't compile with our F77 PRIMOS compiler.

The last time I used PR1MOS was PR1MOS IV, Rev 19.  Back then it
still had some special purpose "write character to terminal" routines.
My memory is mercifully hazy, but I think
	CALL TTOU(char)
wrote a character to the terminal.  Something like that anyway.  This
is precisely the kind of thing that you can hide in a system-dependent
subroutine...

> 2. OPEN (U,FILE='filename',ACCESS='DIRECT',RECL=1).
>    Or at least, that's what I think you guys meant?!
>    I found that PRIMOS inserted an additional character for every write
>    operation.  This was that uncontrollable record character?

Probably not.  PR1MOS used to like records that were a whole number
of 16-bit words.  This may just be padding.

-- 
Heuer's Law:  Any feature is a bug unless it can be turned off.

burley@world.std.com (James C Burley) (09/14/90)

I think its T1OU, not TTOU, but I haven't seen PRIMOS since 19.4 either!

And, you're right, PRIMOS works in 16-bit words in its file system, so the
extra byte is probably just padding.

James Craig Burley, Software Craftsperson    burley@world.std.com