home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / fortran / 4876 < prev    next >
Encoding:
Text File  |  1992-12-31  |  2.4 KB  |  59 lines

  1. Newsgroups: comp.lang.fortran
  2. 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
  3. From: lionel@quark.enet.dec.com (Steve Lionel)
  4. Subject: Re: A VMS Fortran I/O question
  5. Message-ID: <1992Dec31.153918.16765@e2big.mko.dec.com>
  6. Sender: usenet@e2big.mko.dec.com (Mr. USENET)
  7. Organization: Digital Equipment Corporation
  8. References:   <C03pyp.E4v@news.cso.uiuc.edu>
  9. Date: Thu, 31 Dec 1992 15:32:42 GMT
  10. Lines: 47
  11.  
  12.  
  13. In article <C03pyp.E4v@news.cso.uiuc.edu>, ercolessi@uimrl3.mrl.uiuc.edu 
  14. (furio ercolessi) writes...
  15. >Does anybody know (well, Steve Lionel certainly knows, but maybe
  16. >he's in holiday ...) what should I do to kill the carriage control character 
  17. >on the standard output in VMS Fortran ?
  18. >That is, I would like to be able to code something like
  19. >      PRINT '(a)','Hello'
  20. >instead of
  21. >      PRINT '(1x,a)','Hello'
  22. >in order to bring the code back and forth between Unix and VMS and 
  23. >retain the same behavior  [please don't tell me i have to pipe the output 
  24. >through 'asa' on the Unix side :-)]
  25. >I am sure there is some magic OPEN that does the trick.  If you do
  26. >      OPEN(6,FILE='SYS$OUTPUT',STATUS='UNKNOWN',CARRIAGERETURN='LIST')
  27. >then this fixes the WRITE(6,)  but not the PRINTs.
  28. >The PRINTs go to a logical unit called FOR$PRINT but how should I
  29. >reference it in the OPEN?  Is there a magic unit number associated
  30. >with it? 
  31. >Thanks!
  32. >PS  OK, *real programmers* always use WRITE(6,)!
  33.  
  34. Yes, I do know, and no, I'm not on vacation (though perhaps I should be..)
  35. But you're not going to like the answer....
  36.  
  37. There is a magic unit number for FOR$PRINT, -1, but you can't OPEN it
  38. to change the carriage control setting and there's no other way I can
  39. think of to accomplish this.  (Well, there's one, but I'm not sure it
  40. will work - try it and see.  FOR$RAB will return you the RAB of unit
  41. -1, and from that you can get the FAB.  You may then be able to 
  42. SYS$CLOSE the file, change the carriage control to CR ('LIST'),
  43. re-SYS$OPEN and SYS$CONNECT it.  You may have to fuss with the
  44. filename, or perhaps set FAB$V_NAM to make it use the NAM block.  You'll
  45. also have to have done one PRINT first to get the file open before 
  46. FOR$RAB will work.)
  47.  
  48. Is this really easier than using WRITE(6,) instead?
  49.  
  50. Steve Lionel                    lionel@quark.enet.dec.com
  51. SDT Languages Group
  52. Digital Equipment Corporation
  53. 110 Spit Brook Road
  54. Nashua, NH 03062
  55.