Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!amdcad!sun!fatcity!khb From: khb%fatcity@Sun.COM (fatcity) Newsgroups: comp.lang.fortran Subject: Re: ERR= and END= Message-ID: <91480@sun.uucp> Date: 28 Feb 89 03:25:33 GMT References: <2291@unmvax.unm.edu> Sender: news@sun.uucp Reply-To: khb@sun.UUCP (fatcity) Distribution: usa Organization: Sun Microsystems, Mountain View Lines: 28 >In a recent posting, Bill Leonard stated that under certain circumstances >involving errors and end-of-file conditions, .... >discussion of how ERR= should behave.... Personally, I like to use IOSTAT. Combined with some PARAMETERS which define the system values (whatever EOF is, etc.) fairly clean code can then be written, e.g. do i = 1, max read(ilun,'(your format)',IOSTAT=istat) your variable list if (istat .EQ. EOF) then EXIT else if (istat .NE. OK) then call abort('your favorite abort messages',istat) endif your processing goes here end do If one doesn't have EXIT, goto label works just fine. If we assume that goto label is necessary (we are, after all, discussing f77) only one label is necessary, not two. Many systems don't error off, or do anything unpleasant when IOSTAT is specified. Keith H. Bierman It's Not My Fault ---- I Voted for Bill & Opus