[Lazarus] exception handling

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Mar 9 17:29:25 CET 2011


On Wed, 09 Mar 2011 14:17:19 +0100
Andrea Mauri <andrea.mauri.75 at gmail.com> wrote:

> Il 09/03/2011 12:49, Hans-Peter Diettrich ha scritto:
> > I'd check this just before the operation, then you won't get an
> > exception at all. You can wrap that in a MyLn function, if you need ln()
> > more often.
> ok. I know. but my question is more general and it is:
> 
> The gui app handles this operation giving as result b = NaN or Inf and 
> it does not raise any exception while the concole app raise an 
> exception: External SIGFPE.
> 
> How can I obtain the same behaviour on my app both on GUI and console? 
> Which options I have to check?

Some LCL widgetsets use this:

  {$if defined(cpui386) or defined(cpux86_64)}
    {$IFDEF windows}
      Set8087CW($133F);
    {$ELSE}
      SetExceptionMask(GetExceptionMask + [exZeroDivide,exInvalidOp]);
    {$ENDIF}
  {$ifend}


Mattias




More information about the Lazarus mailing list