Home > Language Reference > Classes
Err Class
+ Object
+ Err
Description
The Err class encapsulates all the information relating to errors that occur during execution. This class is not instantiable, cloneable or derivable. The only instance available to the programmer is that declared implicitly under the name Err, and initialized automatically when a runtime error occurs.
When a runtime error occurs, the Number and Description properties pick up the number and description of the error, then control is transferred to the first error handler available declared by the On Error Goto statement. The error handling code can examine these properties in order to decide what action to undertake so that program execution can continue.
In contrast to other programming languages, the Err object is never re-initialized. It always contains information related to the last runtime error regardless of its causes and the route followed subsequently by the program. If you want to reinitialize the Err object, you must call its Clear method.
You can also create and raise your own runtime errors by calling the Raise method. Refer to the description of this method and the list of Runtime errors to find out about the predefined error numbers.
When a runtime error occurs while there is no defined error handler, HB++ call the MsgBox method to open a dialog box displaying the number and description of the last runtime error.
Members
| Members | Description |
| Clear | Resets the Err object. |
| Description | Description of the last runtime error. |
| MsgBox | Displays an error dialog box. |
| Number | Number of the last runtime error. |
| Raise | Generates a runtime error. |
| Inherited from Object | Description |
| ClassID | Returns the type identifier corresponding to the actual class of the object. |
| Implements | Determines whether the object implements the features of a given class. |
| Iterate | Event raised to iterate over the elements of a container object. |
| Recipient | Recipient of events sent by the object. |
| Serialize | Event raised to serialize the object content into a stream. |
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |