Subject: Banal Fortran Question

From: <[email-masked]>
Date: Mon, 27 Jan 1997 09:15:20 -0500

CCLER's:

I am trying to write a program to take external information and feed it into
HYPERCHEM.  One theing that the HYPERCHEM ".ext" file requires is that some
input lines be terminated with a \ (backslash).  The "obvious" way to to write
a backslash in a format statement does not seem to work, i.e. ''\'' , does not
work as the \ is interpreted by the compiler (both on rs6000 and sgi r8000) and
gives an error.

Any hints?

Thanks!

John

-- 

John M. McKelvey			email: [email-masked]
Computational Science Laboratory	phone: (716) 477-3335
2nd Floor, Bldg 83, RL
Eastman Kodak Company			
Rochester, NY 14650-2216

--

---

From: "Dr. Luca Pedocchi" <[email-masked]>
Date: Mon, 27 Jan 1997 17:08:45 +0100

Here is an excerpt from IRIX 6.2 man f77
     -backslash           Treat the backslash character as a normal
character instead of an           escape sequence character.  For
example, when this is used the           sequence "" will be treated as
two separate characters instead of a           single <TAB> character.
I tried just now the following code (if code can be applied ....)

         write(*,'(a1)')'\'
         write(*,'(a1)')char(92)
          stop
          end
If you compile it with the option -backslash it works fine. Anyway,
maybe char(92) is a more standard procedure.
                    Luca
--

Dr. Luca Pedocchi
Laboratorio di Chimica Fisica delle Interfasi
via Cavour, 82 - 50129 Firenze - ITALY

http://lcfs.chim.unifi.it/solid/pedocchi
e-mail [email-masked]

phone +39-55-2757793
fax   +39-55-219802

Non esistono uomini cattivi, se sono cucinati bene
                                            (Stefano Benni)

---

From: "Bruce A. Luxon" <[email-masked]>
Date: Mon, 27 Jan 1997 10:19:35 -0600

Be sure the backslash is escaped with another backslash. I usually
put such stuff into a Hollerith but this may not always be necessary.
This works:

      PROGRAM DUNG
C
      CHARACTER*1 DUNG
C
      OPEN (9,FILE='dung.out',STATUS='new',form='formatted')
C
      DUNG = '\\'
      WRITE(9,'('' '' )')
      WRITE(9,100) DUNG, DUNG
      WRITE(9,'('' '')')
C
100   FORMAT(5X,A1,15X,"MULTISPIN OVERHAUSER RELAXATION",
     2          " ANALYSIS",11X,A1)
C
      CLOSE(9)
      END

Output looks like this:

      \               MULTISPIN OVERHAUSER RELAXATION ANALYSIS           \

Bruce Luxon

On Jan 27,  9:15am, <[email-masked]> wrote:
> Subject: CCL:Banal Fortran Question
> CCLER's:
>
>-- End of excerpt from <[email-masked]>

-- 

*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
*  Bruce A. Luxon, Ph.D                                                    *
*  Assistant Professor                                                     *
*  Sealy Center for Structural Biology                                     U
*  Dept. of Human Biological Chemistry & Genetics                          T
*  University of Texas Medical Branch                                      M
*  Galveston, TX   77555-1157                                              B
*                                                                          *
*  (409)747-6802; Fax (409)747-6850              http://www.hbcg.utmb.edu/ *
*  [email-masked]                            http://www.nmr.utmb.edu/  *
*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*