home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!dbased.nuo.dec.com!e2big.mko.dec.com!quark.enet.dec.com!lionel
- From: lionel@quark.enet.dec.com (Steve Lionel)
- Subject: Re: A VMS Fortran I/O question
- Message-ID: <1992Dec31.153918.16765@e2big.mko.dec.com>
- Sender: usenet@e2big.mko.dec.com (Mr. USENET)
- Organization: Digital Equipment Corporation
- References: <C03pyp.E4v@news.cso.uiuc.edu>
- Date: Thu, 31 Dec 1992 15:32:42 GMT
- Lines: 47
-
-
- In article <C03pyp.E4v@news.cso.uiuc.edu>, ercolessi@uimrl3.mrl.uiuc.edu
- (furio ercolessi) writes...
- >Does anybody know (well, Steve Lionel certainly knows, but maybe
- >he's in holiday ...) what should I do to kill the carriage control character
- >on the standard output in VMS Fortran ?
- >
- >That is, I would like to be able to code something like
- > PRINT '(a)','Hello'
- >instead of
- > PRINT '(1x,a)','Hello'
- >in order to bring the code back and forth between Unix and VMS and
- >retain the same behavior [please don't tell me i have to pipe the output
- >through 'asa' on the Unix side :-)]
- >
- >I am sure there is some magic OPEN that does the trick. If you do
- > OPEN(6,FILE='SYS$OUTPUT',STATUS='UNKNOWN',CARRIAGERETURN='LIST')
- >then this fixes the WRITE(6,) but not the PRINTs.
- >The PRINTs go to a logical unit called FOR$PRINT but how should I
- >reference it in the OPEN? Is there a magic unit number associated
- >with it?
- >
- >Thanks!
- >
- >PS OK, *real programmers* always use WRITE(6,)!
-
- Yes, I do know, and no, I'm not on vacation (though perhaps I should be..)
- But you're not going to like the answer....
-
- There is a magic unit number for FOR$PRINT, -1, but you can't OPEN it
- to change the carriage control setting and there's no other way I can
- think of to accomplish this. (Well, there's one, but I'm not sure it
- will work - try it and see. FOR$RAB will return you the RAB of unit
- -1, and from that you can get the FAB. You may then be able to
- SYS$CLOSE the file, change the carriage control to CR ('LIST'),
- re-SYS$OPEN and SYS$CONNECT it. You may have to fuss with the
- filename, or perhaps set FAB$V_NAM to make it use the NAM block. You'll
- also have to have done one PRINT first to get the file open before
- FOR$RAB will work.)
-
- Is this really easier than using WRITE(6,) instead?
-
- Steve Lionel lionel@quark.enet.dec.com
- SDT Languages Group
- Digital Equipment Corporation
- 110 Spit Brook Road
- Nashua, NH 03062
-