Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!bionet!agate!violet.berkeley.edu!jerry From: jerry@violet.berkeley.edu (Jerry Berkman) Newsgroups: comp.lang.fortran Subject: Re: WRITE don't do that too me! Keywords: WRITE NEWLINE Message-ID: <1990Sep22.190041.5286@agate.berkeley.edu> Date: 22 Sep 90 19:00:41 GMT References: Sender: usenet@agate.berkeley.edu (USENET Administrator) Distribution: comp Organization: University of California, Berkeley Lines: 33 In article quan@sol.surv.utas.oz (Stephen Quan) writes: >Essentially, I am looking for the putchar(x) C-equivalent where x may be any >character. I got close using (if I recall correctly) : >eg. putchar(27) is almost : > INTEGER I > CHARACTER X > EQUIVALENCE (I,X) > X = 27 > WRITE (*,100) X >100 FORMAT(A1) >However, this isn't quite the same as putchar(c) because the WRITE command >also adds a NEWLINE ... I'm trying to write some graphics routines in >FORTRAN. >Stephen Quan. (quan@sol.surv.utas.edu.au) On BSD VAX UNIX systems, and probably others, there are Fortran callable routines: ierr = putc(ch) ierr = fputc(iunit,ch) Also, as I recall, there was a bug in the BSD f77 library which deleted any null characters written with 'a' formats. I'm not sure how long ago it was fixed, but it's probably still around in at least a few systems which copied the source to the libraries before the fix, or in systems never updated. - Jerry Berkman, U.C.Berkeley, (415)642-4804 jerry@violet.berkeley.edu disclaimer: opinions are my own, not my employers, etc.