Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!uokmax!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.fortran Subject: Re: WRITE don't do that too me! Keywords: WRITE NEWLINE Message-ID: <3739@goanna.cs.rmit.oz.au> Date: 12 Sep 90 05:01:08 GMT References: Distribution: comp Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 29 In article , quan@sol.surv.utas.oz (Stephen Quan) writes: > that has lasted since I have started and was wondering if any of you FORTRAN > gurus knew a simple (standard) FORTRAN method to do the following. > INTEGER I > CHARACTER X > EQUIVALENCE (I,X) Equivalencing character and non-character data is *not* defined by the standard. A standard-conforming program cannot do this. If you are using BSD UNIX, that Fortran library has integer function putc(char) character*1 char and integer function fputc(iunit, char) integer iunit character*1 char which do exactly what you want, except for working with characters. Given an integer I, to write it out using putc(), just do putc(char(I)) If you haven't got putc() in your Fortran library, it only takes a few lines of code to set up a common block with a character array and a counter and thus define your own putc(). (Mine takes 32 lines, without using 'include'.) -- Heuer's Law: Any feature is a bug unless it can be turned off.