SignalError – PB Docs 126

SignalError PowerScript function

Description

Causes a SystemError event at the application level.

Syntax

Argument

Description

number (optional)

The integer (stored in the number property
of the Error object) to be used in the message object

text
(optional)

The string (stored in the text property
of the Error object) to be used in the message object

Return Values

Integer. Returns 1 if it succeeds and
-1 if an error occurs. The return value is usually not used.

Usage

During development you can use SignalError to
test error-processing scripts.You can call PopulateError to
populate the Error object and call SignalError without
arguments. You can examine how the SystemError event script handles
the forced error. If you pass the optional number and text arguments
to SignalError, it populates all the fields in
the Error object and then triggers a SystemError event.

In an application, SignalError can also
be useful. For example, if a user error is so severe that you do
not want the application to continue, you can set values in the
Error object, including your own error number, and call SignalError.
You need to include code in the SystemError event script to recognize
and handle the error you have created.If there is no script for
the SystemError event, the SignalError function
does nothing.

For the runtime error numbers assigned to the Number property
of the Error object when an application error occurs, see the PowerBuilder
Users Guide
.

Examples

These statements set values in the Error object and
then trigger a SystemError event so the error processing for these
values can be tested:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x