Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!eecae!netnews.upenn.edu!cattell.psych.upenn.edu!barkdoll From: barkdoll@cattell.psych.upenn.edu (Ed Barkdoll) Newsgroups: comp.sys.ibm.pc Subject: Re: MS Fortran v 5.0 error trapping Message-ID: <1457@cattell.psych.upenn.edu> Date: 26 Jul 89 21:31:42 GMT References: <319@maytag.waterloo.edu> Reply-To: barkdoll@cattell.psych.upenn.edu.UUCP (Ed Barkdoll) Organization: University of Pennsylvania Lines: 27 In article <319@maytag.waterloo.edu> dmurdoch@watstat.waterloo.edu (Duncan Murdoch) writes: > >I've just bought Microsoft Fortran version 5.0, in order to work with a function >minimizing program that was written for a mainframe. My program works, mostly, >but occasionally aborts with overflows or out of range values. On the HP3000 > ... >In the MS Fortran manual, the only mention of error trapping that I can find >has to do with I/O errors. Is it really impossible to trap calculation errors >in MS Fortran? > >Duncan Murdoch In MS fortran 4.1 you can handle so called floating point exceptions by calling LCWRQQ. Page 363 of the manual states: "The LCWRQQ procedure sets the control word to a given value. LCWRQQ has the following declaration: SUBROUTINE LCWRQQ(CW) INTEGER*2 CW The integer*2 argument passed to LCWRQQ is known as the 'users control word'" According to page 362 passing a control word value of 4926 should disable overflow and zero divide errors. I haven't tried it myself so I can't vouch for it and the call may be different for fortran 5.0 Edwin Barkdoll [barkdoll@cattell.psych.upenn.edu]