RoundRectangle control  ScriptDefinition object

Chapter 2: System Object Properties, Events, and Functions

RuntimeError object

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:

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.

Properties

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

Events

RuntimeError event

Occurs

Constructor

When the exception is thrown

Destructor

Immediately after the exception is thrown

Functions

RuntimeError function

Datatype returned

Description

ClassName

String

Returns the name assigned to the object.

GetContextService

Integer

Creates a reference to a context-specific instance of the specified service.

GetMessage

String

Returns the error message from objects of type Throwable.

GetParent

PowerObject

Returns a reference to the name of the parent object.

PostEvent

Boolean

Adds an event to the end of the message queue for the object.

SetMessage

Sets an error message for an object of type Throwable.

TriggerEvent

Integer

Triggers a specific event in the object and executes the script for the event.

TypeOf

Object

Returns the type of the object.





Copyright © 2004. Sybase Inc. All rights reserved. ScriptDefinition object

View this book as PDF