home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!cs.utexas.edu!news.uta.edu!news.uta.edu!sundaram
- From: sundaram@me.uta.edu (Ravi 'Kity Bum' Sundaram)
- Subject: Re: Reinventing WRITE...
- In-Reply-To: spxsjm@thor.cf.ac.uk's message of 16 Dec 92 13:23:01 GMT
- Message-ID: <SUNDARAM.92Dec16101715@me.uta.edu>
- Sender: news@utagraph.uta.edu (USENET News System)
- Nntp-Posting-Host: me.uta.edu
- Organization: none
- References: <29011.9212161323@thor.cf.ac.uk>
- Date: Wed, 16 Dec 1992 16:17:15 GMT
- Lines: 49
-
- In article <29011.9212161323@thor.cf.ac.uk> spxsjm@thor.cf.ac.uk (Mr S J Morris 92) writes:
-
-
- > I want to define a subroutine which will take the same input paramters
- > as a WRITE procedure; that is, I'd like to define
- >
- > SUBROUTINE WRITELN(A,B)
- >
- > in such a way that
- >
- > WRITELN (7,100) X,Y
- > WRITELN (6,*) 'HELLO THERE'
- > WRITELN (*,*) 'HE''S GETTING CLEVER NOW'
- >
- > all work more or less the same as the corresponding WRITE statements (by
- > the way, the reason I'm doing this is to open a file, find the endfile
- > record, append a new record and then close the file again, all in a
- > single call - so that I can flush the output buffer in SUN Fortran). Is
- > there a way of doing this, or am I being hopelessly ambitious (I've been
- > doing some programming in Turbo Pascal for Windows recently, where doing
- > this would be a doddle), or is there in fact another, easier way of
- > flushing the buffer on a Sun (cf. the recent thread on how to do the
- > same on a VAX)?
- >
- > Thanks in advance for any suggestions.
-
- >
- > --
- >
- > Steve Morris,
- > Adran Ffiseg a Seryddiaeth, Coleg Prifysgol Cymru Caerdydd.
- > (Physics and Astronomy Dept., UWC Cardiff)
-
-
- 1.0 I have always used
- CALL FLUSH(IUNIT_NUMBER)
- to flush the buffer. They (all the nice people of this net) told
- me that it is non-standard. But it will work in SUN and SPARC
- All that opening, finding endfile and closing is done just to
- flush the buffer, you can throw it all out and just add a
- CALL FLUSH after every write statement.
-
- 2.0 The reason the thread was long on VAX but not on SUN is probably
- due to availability of CALL FLUSH in SUN.
-
- Ravi Sundaram
- ____________________________________________________________________________
-
-
-