Progress
Language Reference
ERROR-STATUS System Handle
A handle to error information on the last statement executed with the NO-ERROR option.
SYNTAX
attribute
Specifies an attribute of the ERROR-STATUS handle. The attributes are shown in this table.
method
Specifies a method of the ERROR-STATUS handle. The methods are shown in this table.
Method Return Type Description GET-MESSAGE( ) Method ( n ) CHARACTER Returns the error message associated with the nth error that occurred in the statement. GET-NUMBER( ) Method ( n ) INTEGER Returns the Progress system error number associated with the nth error that occurred in the statement.EXAMPLES
The following example uses the NO-ERROR and the ERROR-STATUS handle extensively to demonstrate when ERROR-STATUS attributes are reset.
Within the internal procedure, chk-connect, the first reference to ERROR-STATUS:ERROR returns status on the CONNECT statement from the main procedure. The second reference returns status on the assignment statement. The reference to ERROR-STATUS:ERROR in the main procedure returns status on the RUN statement. Note that the ERROR-STATUS attributes are set only after the statement with NO-ERROR completes. Therefore the references in the internal procedure are not affected by the RUN statement itself.
This procedure accepts a character string value and lets you convert it to one of several data types. The internal convert procedure attempts the conversion. If the conversion is successful, it displays the converted value. If the conversion is unsuccessful, the ERROR-STATUS handle holds error information. After running convert, the CHOOSE trigger checks ERROR-STATUS:ERROR and ERROR-STATUS:NUM-MESSAGES to determine if error information is available. If it is, it lets you view this information.
NOTES
- The ERROR attribute indicates whether the ERROR condition was raised during the execution of the last statement that contained the NO-ERROR option. Some errors may occur without raising the ERROR condition. For example, compiler errors do not raise the ERROR condition.
- The NUM-MESSAGES attribute indicates the total number of errors that occurred during that statement.
- The TYPE attribute returns the widget type, PSEUDO-WIDGET.
- The GET-MESSAGE method and the GET-NUMBER method let you access the error numbers and messages for all errors that occurred during the execution of the last statement with the NO-ERROR option.
- Usually, the NO-ERROR option on a statement suppresses the display of error messages. However, if a STOP condition occurs, the error message is written to the windows. These messages are also available through the ERROR-STATUS attributes. For example, the STOP condition is raised when a procedure to be run is not found. Two specific instances of this are:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |