Consultor Eletrônico



Kbase P82729: 4GL/ABL: How to check for errors and warning messages generated by 4GL/ABL statements with or withou
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/26/2008
Status: Verified

GOAL:

4GL/ABL: How to check for errors and warning messages generated by 4GL/ABL statements with or without the use of NO-ERROR option?

GOAL:

How to trap a Progress 4GL and OpenEdge ABL runtime errors?

GOAL:

How to use the 4GL/ABL _MSG function to check for errors and warnings in a 4GL/ABL runtime session?

FACT(s) (Environment):

All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x

FIX:

One way to trap for runtime errors and warning messages in a 4GL/ABL runtime session is to use the 4GL/ABL _MSG function. This function returns the error/warning message specified by its integer parameter from the current Progress session's error/warning message stack. For example:

MESSAGE _MSG(1)
VIEW-AS ALERT-BOX INFO BUTTONS OK.

returns the error message number of the last message/warning of the current Progress session.

MESSAGE _MSG(2)
VIEW-AS ALERT-BOX INFO BUTTONS OK.

returns the number of the message/warning before the last message/warning of the current Progress session.

These results are returned by the _MSG function even when the current SESSION:SUPPRESS-WARNINGS attribute is set to TRUE:

SESSION:SUPPRESS-WARNINGS = TRUE.

For sample uses of this function see the code in the note attached with this solution.