Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!unixhub!slacvm!kencb From: KENCB@SLACVM.SLAC.STANFORD.EDU Newsgroups: comp.lang.fortran Subject: Re: Is this kosher? Message-ID: <91030.132436KENCB@SLACVM.SLAC.STANFORD.EDU> Date: 30 Jan 91 21:24:36 GMT References: <20773@hydra.gatech.EDU> <2796@dftsrv.gsfc.nasa.gov> <20785@hydra.gatech.EDU> <2812@dftsrv.gsfc.nasa.gov> Organization: Stanford Linear Accelerator Center Lines: 46 Jim Jagielski replied: >>In article <20785@hydra.gatech.EDU> gt4512c@prism.gatech.EDU (BRADBERRY,JOHN L) >>writes: >>}In article <2796@dftsrv.gsfc.nasa.gov> jim@jagubox.gsfc.nasa.gov (Jim >>Jagielski) writes: >>}>In article <20773@hydra.gatech.EDU> gt4512c@prism.gatech.EDU (BRADBERRY,JOHN >>L) writes: >>}>}In article <2787@dftsrv.gsfc.nasa.gov> jim@jagubox.gsfc.nasa.gov (Jim >>Jagielski) writes: >>}> >>}>It ain't my code... I've seen this quite a few times on VAX machines (their >>}>FORTRAN accepts it without even a hiccup) but, of course, when porting to >>}>other machines the code dies a horrible death. Sometimes it does make sense >>}>to do this if the block you are referring back to is large... of course, in >>}>that case is better to just make it "into" a subroutine and use it as such. >>}> [stuff deleted] I was very suprised at the VAX Fortran reference because ever since I first read the VAX Fortran manual (VMS V2.1), I "knew" you weren't supposed to jump into a IF-block. Quoting from the current maunal (VMS V5.x, VAX Fortran V5.x) description of Block IF Statements (Sect. 5.7.3), p 5-21: "5.7.3.1 Statement Blocks A statement block can contain any executable FORTRAN statement except an END statement. You can transfer control out of a statement block, but you must not transfer control into a block. Thus, you must not transfer control from one statement block to another." The second sentence is the relavent one. However, MUCH to my SURPRISE, John's test program fragment compiled just FINE under VAX Fortran! Sheez! I think it's time for an SPR on this... but then I don't know the history (PDP-11 compatibility, etc.). -Ken +---------------------------------------------------------------------------+ | Kenneth H. Fairfield | Internet: Fairfield@Tpc.Slac.Stanford.Edu | | SLAC | DECnet: 45047::FAIRFIELD | | P.O.Box 4349, Bin 98 | BITNET Fairfield@SlacTpc | | Stanford, CA 94309 | Phone: (415) 926-2924 | +---------------------------------------------------------------------------+ "These opinions are worth what you paid for 'em... ...and are they mine, not SLAC's, Stanford's, nor the DOE's..."