Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!aristotle!ems From: ems@aristotle.JPL.NASA.gov (Eric Slimko) Newsgroups: comp.lang.fortran Subject: Writing newlines to strings Message-ID: <1990Nov29.164527.23915@elroy.jpl.nasa.gov> Date: 29 Nov 90 16:45:27 GMT Sender: news@elroy.jpl.nasa.gov (Usenet) Reply-To: ems@aristotle.jpl.nasa.gov Organization: Jet Propulsion Laboratory, NASA/Caltech Lines: 24 Nntp-Posting-Host: aristotle.jpl.nasa.gov I'd like to write a newline character to a string using a FORMAT statement. Unfortunately, while I can write them to the screen, I can't seem to find a way to write them to a string. The code fragement I am working with is like this: CHARACTER*512 ERRMSG WRITE(ERRMSG,1001) 0.7733383D0, -0.5141431981D0 1001 FORMAT(/'ERROR IN READING PLANETARY EPHEMERIS FILE --', * 'REQUESTED TIME TOO EARLY'/ * ' REQUESTED TIME = ',D25.15/ * ' FILE START TIME = ',D25.15) The forward slash (/) is a kind of end-of-record marker in Fortran and will cause an error when written to a string. I have used the C-type newline (\n) within the string and had it work for Sun Fortran, but that is not portable, which it must be. Is there a standard that I'm missing? I'd appreciate E-Mail if you could, because I'm an estranged C-Programmer and don't read this newgroup often. :-) -- Eric Slimko | Jet Propulsion Laboratories ems@aristotle.jpl.nasa.gov | NASA/CalTech