PureBasic - OnError

Overview

PureBasic does not include any error checking in compiled executables, allowing them to be as small and fast as possible. This can be a drawback as, if a program crashes, there is no way to get precise information on the cause of the problem. This library is here to fill in this gap.

While coding you can use the debugger, which is a good tool for debugging but not quite so good for embedding in your fully developed program, as it slows down your code by up to a factor of six.

With this set of functions you are able to introduce advanced error checking routines into your programs without sacrificing the full efficiency of PureBasic.

All of the functions in this library are written in assembly and have been hand optimised. This library is split, meaning that the only functions that are included in your compiled executable are those which you have actually used.

Command Index

ClearError
DisASMCommand
GetCurrentEIP
GetDisASMString
GetErrorAddress
GetErrorCounter
GetErrorDLL
GetErrorDescription
GetErrorLineNR
GetErrorModuleName
GetErrorNumber
GetErrorRegister
GoToEIP
OnErrorExit
OnErrorGosub
OnErrorGoto
OnErrorResume
SetErrorNumber

Example

OnError.pb

Supported OS

Windows

Reference Manual - Index