Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* fortran carriage control in STDERR
@ 1995-10-31  5:00 Luis A. Suarez
  1995-11-03  5:00 ` Steve Lionel
  0 siblings, 1 reply; 2+ messages in thread
From: Luis A. Suarez @ 1995-10-31  5:00 UTC (permalink / raw)
  Cc: luis



Greetings.

My question is: how can I make STDERR to honor fortran carriage control
information and i/o redirection at the same time?

example: consider the program below:
      program T00
c
      integer         uerr, ios, jj
      character*(80)  q0tmp
c
      uerr = 0				   ! STDERR
 9110 format ('+', a)			   ! overprint string
      do jj = 1, 5
         write (uerr, 9110) 'default STDERR'
      enddo
c
      q0tmp = '/dev/tty'
      open (unit=uerr, file=q0tmp, status='unknown', iostat=ios,
     &      carriagecontrol='FORTRAN', err=110)
      do jj = 1, 5
         write (uerr, 9110) 'redefined STDERR'
      enddo
c
  110 continue
      stop
      end

The program was compiled with the command:

  $f77 -u -cross_reference -V -C -extend_source -g2 -warn nouncalled  \
                                   -synchronous_exceptions -o t00 t00.f

I do not want to use the switch "-vms" because it would introduce more
problems. Using the Bourne shell:

	(Bourne shell) t00
	+default STDERR
	+default STDERR
	+default STDERR
	+default STDERR
	+default STDERR
	redefined STDERR

notice that the default definition of STDERR did not honor overprint (the
statement is present in the output five times). the redefinition did overprint
(only one statement is present). now:

	(Bourne shell) t00 > w.del  2>&1
	redefined STDERR

notice that only the default definition of STDERR was redirected.

So, how can I have both carriage control + i/o redirection?

Thank you,
--
Luis A. Suarez (luis@itzamn.ath.epa.gov)




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: fortran carriage control in STDERR
  1995-10-31  5:00 fortran carriage control in STDERR Luis A. Suarez
@ 1995-11-03  5:00 ` Steve Lionel
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Lionel @ 1995-11-03  5:00 UTC (permalink / raw)



In article <DHBK3I.Mp9@rtpnc.epa.gov>, luis@itzamn.ath.epa.gov (Luis A. Suarez)
 writes:
|>My question is: how can I make STDERR to honor fortran carriage control
|>information and i/o redirection at the same time?

Luis had also sent this question to me by mail.  My answer was as follows:

The answer is yes and no.  The "file" name must be omitted in order to
redirect the output to STDERR.  And indeed this program works when the
file name is omitted; however, the output file will appear as follows:

+default STDERR
+default STDERR
+default STDERR
+default STDERR
+default STDERR
redefined STDERR^Mredefined STDERR^Mredefined STDERR^MredefinedSTDERR^Mredefined STDERR^M

Note that the carriage controls (^M) are written to the file as raw 
characters as the file does not know if/how to format it.  If this same
file was then output to a terminal ("cat w.del") it would then appear
as you wish ("redefined STDERR" would be overstruck).
-- 

Steve Lionel                      Mail: lionel@quark.enet.dec.com
DEC Fortran Development           WWW:  http://www.digital.com/info/slionel.html
Digital Equipment Corporation     CompuServe: 75263,3001
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698             "Free advice is worth every cent"

For information on DEC Fortran 90, see http://www.digital.com/info/hpc/f90/



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-11-03  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-10-31  5:00 fortran carriage control in STDERR Luis A. Suarez
1995-11-03  5:00 ` Steve Lionel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox