Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!news.cs.indiana.edu!news.nd.edu!mentor.cc.purdue.edu!seaman.cc.purdue.edu!ags From: ags@seaman.cc.purdue.edu (Dave Seaman) Newsgroups: comp.lang.fortran Subject: Re: Checking a string for an integer Message-ID: <9226@mentor.cc.purdue.edu> Date: 1 Apr 91 22:41:53 GMT References: <1991Apr1.104227.243@biivax.dp.beckman.com> <7875@jhunix.HCF.JHU.EDU> Sender: news@mentor.cc.purdue.edu Reply-To: ags@seaman.cc.purdue.edu (Dave Seaman) Organization: Purdue University Lines: 16 In article <7875@jhunix.HCF.JHU.EDU> ereiamjh@jhunix.HCF.JHU.EDU (Tom B. O'Toole) writes: >It's very easy to do. You basically do something like: > character*3 string >... > read(string,*,err=99)input >... >99 WRITE(6,*) 'a non integer string representation' It's not quite as easy as that, because Fortran 77 does not allow list-directed I/O on internal files. Therefore, you need to use an actual format in the read statement. -- Dave Seaman ags@seaman.cc.purdue.edu