[Done] OnErrorGoto() doesn't work
Posted: Sun May 04, 2025 5:01 pm
The help example for OnErrorGoto() doesn't work (tested on Linux Mint 21.3 x64 'Virginia' with Cinnamon and PB 6.20, it works like a charm on MacOS and Windows 10). The jump to the ErrorHandler is not executed and the program is terminated without any message (with Debugger turned off):
Code: Select all
CompilerIf #PB_Compiler_Debugger
CompilerError "The debugger must be turned OFF for this example"
CompilerEndIf
MessageRequester("OnError test", "Test start")
OnErrorGoto(?ErrorHandler)
PokeS(10, "Hello World") ; Cause a #PB_OnError_InvalidMemory error
MessageRequester("OnError test", "This should never be displayed")
End
ErrorHandler:
MessageRequester("OnError test", "The following error happened: " + ErrorMessage())
End