Trapping I/O runtime errors in GPC_(re)
Tue, 28 Oct 1997 20:15:23 GMT
Bill Currie wrote:
> On 27 Oct 97 at 8:50, Frank Heckenbach wrote:
>
> > I think I can do the RTS part, if you send me a patch for your
> > changes, along with a short description about how you did it.
>
> I'll have to sort though my mods to bring them up to date with the
> latest beta.
Fine! Don't hurry, I've got some other programming to do currently...
> > - After calling an I/O function, if {$I+} is turned on, the calling
> > program
> > must check InOutRes. The code to be generated (perhaps you've
> > already done so) would look like "if InOutRes<>0 then _p_ioerror;"
> > where _p_ioerror will be a RTS function I can provide. (The check
> > "if InOutRes<>0" could also be done in the function (like in BP!),
> > but that's inefficient, because the function has to be called
> > after each I/O operation then.)
>
> Actually, that's almost exactly what my mods do. If IO checking is
> enabled ( {$I+} ), a proceedure taking no parameters is called that
> would check the InOutRes state (though I used a different name) and
> if it's set dumps a dirty message and aborts the program.
I might modify this procedure a bit to use the (current) standard way of
handling runtime errors (_p_generic and such), but this shouldn't be a
problem. However, if you could move the check into the program, this would
gain some efficiency.
--
Frank Heckenbach, Erlangen, Germany
heckenb@mi.uni-erlangen.de
http://home.pages.de/~fjf/links.htm
Frank Heckenbach (heckenb@mi.uni-erlangen.de)
HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada -
Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es