Error

Description

Occurs when an error is found in a data or property expression for an external object or a DataWindow object. Also occurs when a communications error is found in a client connecting to EAServer.

NoteImproved error-handling capability The Error event is maintained for backward compatibility only. If you do not script the Error event or change its action argument, information from this event is passed to RuntimeError objects, such as DWRuntimeError. You can handle these errors in a try-catch block.

Event ID

Event ID

Objects

None

Connection, DataWindow, DataStore

Arguments

Argument

Description

errornumber

Unsigned integer by value (PocketBuilder’s error number)

errortext

String, read-only (PocketBuilder’s error message)

errorwindowmenu

String, read-only (the name of the window or menu that is the parent of the object whose script caused the error)

errorobject

String, read-only (the name of the object whose script caused the error)

errorscript

String, read-only (the full text of the script in which the error occurred)

errorline

Unsigned integer by value (the line in the script where the error occurred)

action

ExceptionAction by reference.

A value you specify to control the application’s course of action as a result of the error. Values are:

  • ExceptionFail! — fail as if this script were not implemented. The error condition triggers any active event handlers, or if none, the SystemError event.

  • ExceptionIgnore! — ignore this error and return as if no error occurred (use this option with caution because the conditions that caused the error can cause another error).

  • ExceptionRetry! — execute the function or evaluate the expression again in case the OLE server was not ready. This option is not valid for DataWindows.

  • ExceptionSubstituteReturnValue! — use the value specified in the returnvalue argument instead of the value returned by the OLE server or DataWindow, and cancel the error condition.

returnvalue

Any by reference (a value whose datatype matches the expected value that the OLE server or DataWindow would have returned).

This value is used when the value of action is ExceptionSubstituteReturnValue!.

Returns

None. Do not use a RETURN statement.

Examples

Example 1

This example displays information about the error that occurred and allows the script to continue:

MessageBox("Error Number " + string(errornumber)&
   + " Occurred", "Errortext: " + String(errortext))
action = ExceptionIgnore! 

See also