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