FPEnvRaiseExceptionMethod
Syntax
FPEnvRaiseException(Exception)
Example 1: Raising a floating point exception
Sub FPEnvRaiseTestCB(ByVal ExprPartPtr As IntPtr)
Dim ExprPart As New uCalc.Callback(ExprPartPtr)
ExprPart.GetuCalc().FPEnvRaiseException(FPEnvExceptionEnum.Invalid)
End Sub
Sub FPEnvRaiseTest()
uc.DefineFunction("FPEnvRaiseTest()", uc.PinAddr(AddressOf FPEnvRaiseTestCB))
Console.WriteLine(uc.EvalStr("FPEnvRaiseTest()"))
End Sub
static void FPEnvRaiseTestCB(IntPtr ExprPartPtr) {
var ExprPart = New uCalc.Callback(ExprPartPtr);
ExprPart.GetuCalc().FPEnvRaiseException(FPEnvExceptionEnum.Invalid);
}
static void FPEnvRaiseTest() {
uc.DefineFunction("FPEnvRaiseTest()", uc.PinAddr(FPEnvRaiseTestCB));
Console.WriteLine(uc.EvalStr("FPEnvRaiseTest()"));
}
procedure FPEnvRaiseTestCB(ExprPartPtr: System.Pointer);
begin
ExprPart.GetuCalc().FPEnvRaiseException(FPEnvExceptionEnum.Invalid);
End;
procedure FPEnvRaiseTest();
begin
uc.DefineFunction('FPEnvRaiseTest()', FPEnvRaiseTestCB);
WriteLn(uc.EvalStr('FPEnvRaiseTest()'));
End;
void _stdcall FPEnvRaiseTestCB(uCalcPtr ExprPartPtr) {
auto ExprPart = uCalc::Callback(ExprPartPtr);
ExprPart.GetuCalc().FPEnvRaiseException(FPEnvExceptionEnum::Invalid);
}
void FPEnvRaiseTest() {
uc.DefineFunction("FPEnvRaiseTest()", FPEnvRaiseTestCB);
cout << uc.EvalStr("FPEnvRaiseTest()") << endl;
}
static void FPEnvRaiseTestCB(uCalcPtr ExprPartPtr) {
auto ExprPart = uCalc::Callback(ExprPartPtr);
ExprPart.GetuCalc().FPEnvRaiseException(FPEnvExceptionEnum::Invalid);
}
static void FPEnvRaiseTest() {
uc.DefineFunction("FPEnvRaiseTest()", ucPinAddr(FPEnvRaiseTestCB));
Console::WriteLine(uc.EvalStr("FPEnvRaiseTest()"));
}
DLL import code
<DllImport(uCalcDLL, CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.Cdecl, EntryPoint:="FPEnvRaiseException")> _
Private Function FPEnvRaiseException__(ByVal uCalcHandle As IntPtr, ByVal Exception As FPEnvExceptionEnum ) As Int32
End Function
[DllImport(uCalcDLL, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl, EntryPoint="FPEnvRaiseException")]
protected static extern Int32 FPEnvRaiseException_(IntPtr uCalcHandle, FPEnvExceptionEnum Exception );
{DLLImport}function FPEnvRaiseException__(uCalcHandle: System.Pointer; Exception: FPEnvExceptionEnum): Int32; cdecl; external uCalcDLL name 'FPEnvRaiseException';
typedef int32_t (* __FPEnvRaiseException)(void *uCalcHandle, FPEnvExceptionEnum Exception );
[DllImport(uCalcLib, CharSet=CharSet::Ansi, CallingConvention=CallingConvention::Cdecl, EntryPoint = "FPEnvRaiseException")]
static Int32 FPEnvRaiseException_(void * uCalcHandle, FPEnvExceptionEnum Exception);