Page 1 of 1

[Done] OnErrorGoto() doesn't work

Posted: Sun May 04, 2025 5:01 pm
by Shardik
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

Re: OnErrorGoto() doesn't work

Posted: Sun May 04, 2025 6:53 pm
by mk-soft
Does not work with any version (pb v6.03 +)

Re: OnErrorGoto() doesn't work

Posted: Sun May 04, 2025 8:37 pm
by Shardik
The OnErrorGoto() example also doesn't work in PB 5.46 x64 and 5.73 x64.

But on Debian 12 'Bookworm' x86 in PB 6.10 x86 the example works like a charm. So it appears to be a problem of the 64-bit version of PureBasic!

Re: [Done] OnErrorGoto() doesn't work

Posted: Fri Aug 01, 2025 10:24 am
by Fred
Fixed.