Consultor Eletrônico



Kbase P165925: Can the 4GL runtime error returned by the ERROR-STATUS:ERROR attribute be overwritten 
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/20/2010
Status: Unverified

GOAL:

Can the 4GL runtime error returned by the ERROR-STATUS:ERROR attribute be overwritten

GOAL:

Is there anyway to set the ERROR-STATUS:ERROR to NO?

GOAL:

Is there anyway to clear the error messages returned by the ERROR-STATUS:GET-MESSAGES() method?

FACT(s) (Environment):

All Supported Operating Systems
Progress/OpenEdge Product Family
OpenEdge Category: Language (4GL/ABL)

FIX:

Since the ERROR-STATUS system handle stores error information on the last statement executed with the NO-ERROR option, the way to "overwrite" that information is to execute another statement with the NO-ERROR option that we know cannot fail. For example, executing the following code sets the ERROR-STATUS:ERROR to NO and clears the error messages returned by the ERROR-STATUS:GET-MESSAGES() method:
DEFINE VARIABLE iDummy AS INTEGER NO-UNDO.
DEFINE TEMP-TABLE tt NO-UNDO
FIELD cfield AS CHAR.
FIND FIRST tt NO-ERROR.
IF ERROR-STATUS:ERROR THEN
ASSIGN
iDummy = 1 NO-ERROR.

Since the ERROR-STATUS:ERROR attribute is a readable/writable attribute, it can be set to NO by simply executing the statement:
ERROR-STATUS:ERROR = NO.
Note that setting the ERROR-STATUS:ERROR attribute to NO does not clear the error messages returned by the ERROR-STATUS:GET-MESSAGES() method.