Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!elroy.jpl.nasa.gov!jato!vsnyder From: vsnyder@jato.jpl.nasa.gov (Van Snyder) Newsgroups: comp.lang.fortran Subject: Re: integer variable format address Message-ID: <1991Mar8.020651.27088@jato.jpl.nasa.gov> Date: 8 Mar 91 02:06:51 GMT References: <6769@idunno.Princeton.EDU> <1991Mar6.183820.8807@bellcore.bellcore.com> Reply-To: vsnyder@jato.Jpl.Nasa.Gov (Van Snyder) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 45 In article <1991Mar6.183820.8807@bellcore.bellcore.com> dph@breeze.UUCP (Daniel P Heyman) writes: >>>What is wrong with the following program? >>> program test >>> integer k >>> k=1 >>> write(*,k) >>> >>> 1 format('here is line 1') >>> end >>> >>>I have two FORTRAN books that suggest the write(*,k) >>>statement should work. I have two FORTRAN compilers >>>that give a bus error. Any ideas would be appreciated. >> >I used the parameter statement and got the program to run. > parameter(k=1) >Dan Heyman dph@bellcore.bellcore.com I think your compiler doesn't compile the language specified by X3.9-1978. See page 12-8, lines 10-14. Then read page 10-2, lines 34-36. For your convenience I quote them here: ... (2) An integer variable name that has been assigned the statement label of a FORMAT statement... Execution of a statement label assignment statement [ASSIGN statement] is *the only way* that a variable may be defined with a statement label value. (my comment in [], and my emphasis in **). Parameter statements can associate names to constant expressions (6.7). Constant expressions can be "arithmetic constant expression (6.1.3), a character constant expression (6.2.3), or a logical constant expression (6.4.4)." If you track those down, you'll find nothing about statement labels. Regards. Van -- vsnyder@jato.Jpl.Nasa.Gov ames!elroy!jato!vsnyder vsnyder@jato.uucp