Your Delphi is very strange, tested on 4 different versions of delphi (10.4 and 11.3 pro and enterprise) with "default compilation option" :
Both showmessage, give me an access violation EinvalidOp with message 'Invalide floating point operation at adress 043C52F"
Yes I confirm it raise EInvalidOP exception with your project (or not). Do you have a customized version of Delphi ? Because your project raise EInvalidOP exception "Floating point invalid operation" :
I don't have a customized version of Delphi. It's clear this is not a Scripter issue, but something regarding Math operations and exceptions handling.
I'm not expert in math operations, maybe it has to do with the underlying Windows OS as well, I don't know. I know you can set exception mask flags in Math lib to enable/disable exceptions.
I have checked this with other developers and confirmed that NaN is displayed.
Floating-point exceptions that can occur in Delphi or C++ applications are listed in the following table.
Undefined floating-point instruction or invalid mathematical operation.
For example, Sqrt(-1), ArcTan(10), 0/0, or Partial Loss of Precision.
And the problem it is in same Delphi TMS Scripter doesn't raise the same exception...
I tried your last project, but then I did it run in two different computers. I was using Delphi on a Windows ARM. Then I tested in a regular Windows x64.
Your project raises no exceptions from any button when running in Windows ARM. And it raises exception from all buttons in Windows x64.
But, I then tried to run your original script that tries to divide by 0, and it also raises exception in the Windows x64. So everything works as expected.
Yes nice idea, in attachment a full project VCL WIN32 (no Firemonkey).
Both button (Delphi and scripter) raise Divide by zero exception. It's good.
But I found why :
uCEFApplicationCore.pas (CEF For Delphi)
And I have added it to scripter
do :
SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]);
Yes my problem is about SetExceptionMask done by one of my libraries I use with scripter.
Finally It's doesn't come from CEF For Delphi but another one because I use more than 30 libraries.
Do you think that force ExceptionMask could be a good idea, like that :