The RuntimeError object inherits from the Throwable object and is used by the PocketBuilder virtual machine (PBVM) to throw runtime errors. Runtime errors are also called unchecked exceptions. You do not need to declare where they might be thrown and you do not need to catch them as you do checked exceptions.
When a RuntimeError is thrown, its properties are populated automatically with the runtime information associated with the line where the error occurred. If a RuntimeError is not handled, the Application object SystemError event is triggered and the global Error object is populated with the runtime information.
The following derived types provide more robust error-handling capabilities:
DivideByZeroError – thrown when an attempt is made to divide by zero.
NullObjectError – thrown when an attempt is made to access an object using a null reference.
DWRuntimeError – thrown when a DataWindow error occurs that is not handled by an Error event script.
The descendants of RuntimeError allow you to handle specific runtime errors. For example, you could catch only NullObjectError exceptions in a specific block of code. Alternatively, you can catch all runtime errors with a single CATCH statement.
RuntimeError property |
Datatype |
Description |
---|---|---|
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control |
Class |
String |
Name of the class where the exception occurred |
DLLName |
String |
(PBXRuntimeError only) Name of the PocketBuilder extension DLL where the exception occurred |
Line |
Integer |
Line number where the exception occurred |
Number |
Integer |
Identifies the PocketBuilder error |
ObjectName |
String |
Name of the object where the exception occurred |
RoutineName |
String |
Name of the event or routine where the exception occurred |
Text |
String |
Text associated with the type of exception |
RuntimeError event |
Occurs |
---|---|
When the exception is thrown |
|
Immediately after the exception is thrown |
RuntimeError function |
Datatype returned |
Description |
---|---|---|
String |
Returns the name assigned to the object. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
String |
Returns the error message from objects of type Throwable. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Boolean |
Adds an event to the end of the message queue for the object. |
|
— |
Sets an error message for an object of type Throwable. |
|
Integer |
Triggers a specific event in the object and executes the script for the event. |
|
Object |
Returns the type of the object. |
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |