home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / fortran / 4888 < prev    next >
Encoding:
Text File  |  1993-01-02  |  2.6 KB  |  56 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!hermes.chpc.utexas.edu!michael
  3. From: michael@chpc.utexas.edu (Michael Lemke)
  4. Subject: Re: A VMS Fortran I/O question
  5. Message-ID: <1993Jan3.040453.20688@chpc.utexas.edu>
  6. Organization: The University of Texas System - CHPC
  7. References: <C03pyp.E4v@news.cso.uiuc.edu> <MARBY.93Jan2161438@laura.harvard.edu>
  8. Date: Sun, 3 Jan 93 04:04:53 GMT
  9. Lines: 45
  10.  
  11. In article <MARBY.93Jan2161438@laura.harvard.edu> marby@laura.harvard.edu (Craig Marby) writes:
  12. >>>>>> On 31 Dec 92 02:08:48 GMT, ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi) said:
  13. >
  14. >furio> Does anybody know (well, Steve Lionel certainly knows, but maybe
  15. >furio> he's in holiday ...) what should I do to kill the carriage control character 
  16. >furio> on the standard output in VMS Fortran ?
  17. >
  18. >furio> That is, I would like to be able to code something like
  19. >furio>       PRINT '(a)','Hello'
  20. >furio> instead of
  21. >furio>       PRINT '(1x,a)','Hello'
  22. >furio> in order to bring the code back and forth between Unix and VMS and 
  23. >furio> retain the same behavior
  24. >
  25. >How about the following solution.
  26. >
  27. >1. Create a temporary mailbox (pick your own name)
  28. >2. Assign logical FOR$PRINT to point to this mailbox.
  29. >3. Set up a write-attention AST on the mailbox using a SYS$QIO.
  30. >4. Wait for a PRINT statement to be executed.
  31. >5. Every time your AST is called (which will be line by line) read
  32. >   the line out of the mailbox and add an extra space at the
  33. >   beginning. You can then send it to where ever you want (you may
  34. >   want to determine this prior to step 1).
  35.  
  36. Umm, that will certainly work but isn't a bit overkill?  I don't know
  37. how it affects performance but it certainly requires quite a bit of
  38. non-portable code.  I'd rather think the *Unix* stuff should honor
  39. FORTRAN carriage control.  Well, I know it doesn't but a PRINT
  40. statement after all creates a print file (or even sends something to a
  41. printer), so doesn't FORTRAN require print files to honor the carriage
  42. control character?  What is the excuse this time that the Unix joke is
  43. still standard conform?  I'd discourage the practice to write code
  44. without carriage control characters as the standard requires them,
  45. doesn't it?  BTW, in Sun Fortran there is a special STATUS='PRINT' in
  46. the OPEN statement which causes the first character to be ignored if a
  47. blank or to be converted to a CTRL/L if a 1 etc.  `+' does not work
  48. though. This evne works for stdout but I don't know about PRINT.  Maybe 
  49. your Unix compiler has something similar.
  50.  
  51. Michael
  52. -- 
  53. Michael Lemke
  54. Astronomy, UT Austin, Texas
  55. (michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])
  56.