home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / fortran / 4886 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  1.8 KB

  1. Path: sparky!uunet!usc!howland.reston.ans.net!hsdndev!marby
  2. From: marby@laura.harvard.edu (Craig Marby)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: A VMS Fortran I/O question
  5. Message-ID: <MARBY.93Jan2161438@laura.harvard.edu>
  6. Date: 2 Jan 93 21:14:38 GMT
  7. References: <C03pyp.E4v@news.cso.uiuc.edu>
  8. Sender: usenet@hsdndev.UUCP
  9. Organization: Chemistry Dept., Harvard University
  10. Lines: 36
  11. In-reply-to: ercolessi@uimrl3.mrl.uiuc.edu's message of 31 Dec 92 02:08:48 GMT
  12.  
  13. >>>>> On 31 Dec 92 02:08:48 GMT, ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi) said:
  14.  
  15. furio> Does anybody know (well, Steve Lionel certainly knows, but maybe
  16. furio> he's in holiday ...) what should I do to kill the carriage control character 
  17. furio> on the standard output in VMS Fortran ?
  18.  
  19. furio> That is, I would like to be able to code something like
  20. furio>       PRINT '(a)','Hello'
  21. furio> instead of
  22. furio>       PRINT '(1x,a)','Hello'
  23. furio> in order to bring the code back and forth between Unix and VMS and 
  24. furio> retain the same behavior
  25.  
  26. How about the following solution.
  27.  
  28. 1. Create a temporary mailbox (pick your own name)
  29. 2. Assign logical FOR$PRINT to point to this mailbox.
  30. 3. Set up a write-attention AST on the mailbox using a SYS$QIO.
  31. 4. Wait for a PRINT statement to be executed.
  32. 5. Every time your AST is called (which will be line by line) read
  33.    the line out of the mailbox and add an extra space at the
  34.    beginning. You can then send it to where ever you want (you may
  35.    want to determine this prior to step 1).
  36.  
  37. The above solution seems viable to me (and I have implemented
  38. something similiar). It enables you, for example, to count the number
  39. of lines written to a particular device. The above does involve some
  40. non-trivial VMS specific coding however.
  41.  
  42. Hope this helps.
  43. --
  44.  
  45.     __o         
  46.   _ \<,_       Craig A. Marby    marby@layla.harvard.edu
  47.  (_)/ (_)      
  48. ~~~~~~~~~~
  49.