home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4764 < prev    next >
Encoding:
Text File  |  1992-12-16  |  2.2 KB  |  63 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!cs.utexas.edu!news.uta.edu!news.uta.edu!sundaram
  3. From: sundaram@me.uta.edu (Ravi 'Kity Bum' Sundaram)
  4. Subject: Re: Reinventing WRITE...
  5. In-Reply-To: spxsjm@thor.cf.ac.uk's message of 16 Dec 92 13:23:01 GMT
  6. Message-ID: <SUNDARAM.92Dec16101715@me.uta.edu>
  7. Sender: news@utagraph.uta.edu (USENET News System)
  8. Nntp-Posting-Host: me.uta.edu
  9. Organization: none
  10. References: <29011.9212161323@thor.cf.ac.uk>
  11. Date: Wed, 16 Dec 1992 16:17:15 GMT
  12. Lines: 49
  13.  
  14. In article <29011.9212161323@thor.cf.ac.uk> spxsjm@thor.cf.ac.uk (Mr S J Morris 92) writes:
  15.  
  16.  
  17. >   I want to define a subroutine which will take the same input paramters
  18. >   as a WRITE procedure; that is, I'd like to define
  19. >
  20. >     SUBROUTINE WRITELN(A,B)
  21. >
  22. >   in such a way that
  23. >
  24. >     WRITELN (7,100) X,Y
  25. >     WRITELN (6,*) 'HELLO THERE'
  26. >     WRITELN (*,*) 'HE''S GETTING CLEVER NOW'
  27. >
  28. >   all work more or less the same as the corresponding WRITE statements (by
  29. >   the way, the reason I'm doing this is to open a file, find the endfile
  30. >   record, append a new record and then close the file again, all in a
  31. >   single call - so that I can flush the output buffer in SUN Fortran). Is
  32. >   there a way of doing this, or am I being hopelessly ambitious (I've been
  33. >   doing some programming in Turbo Pascal for Windows recently, where doing
  34. >   this would be a doddle), or is there in fact another, easier way of
  35. >   flushing the buffer on a Sun (cf. the recent thread on how to do the
  36. >   same on a VAX)?
  37. >
  38. >   Thanks in advance for any suggestions.
  39.  
  40. >
  41. >   -- 
  42. >
  43. >   Steve Morris,
  44. >   Adran Ffiseg a Seryddiaeth, Coleg Prifysgol Cymru Caerdydd.
  45. >   (Physics and Astronomy Dept., UWC Cardiff)
  46.  
  47.  
  48. 1.0    I have always used
  49.     CALL FLUSH(IUNIT_NUMBER)
  50.     to flush the buffer. They (all the nice people of this net) told 
  51.     me that it is non-standard. But it will work in SUN and SPARC
  52.     All that opening, finding endfile and closing is done just to 
  53.     flush the buffer, you can throw it all out and just add a
  54.     CALL FLUSH after every write statement. 
  55.  
  56. 2.0    The reason the thread was long on VAX but not on SUN is probably
  57.     due to availability of CALL FLUSH in SUN.
  58.  
  59.     Ravi Sundaram
  60. ____________________________________________________________________________
  61.  
  62.     
  63.