Consultor Eletrônico



Kbase P122548: CREATE <handle variable> NO-ERROR does not set ERROR-STATUS:ERROR if variable is an array element
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

FACT(s) (Environment):

OpenEdge 10.1B

SYMPTOM(s):

CREATE <handle variable> NO-ERROR does not set ERROR-STATUS:ERROR to TRUE.

Error messages shown if same statement is invoked without NO-ERROR.

<handle variable> is an element of an array of type HANDLE.

CAUSE:

This is a known issue.

The following code reproduces the problem:

DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO EXTENT 15.

CREATE BUFFER hBuffer[1] FOR TABLE "aaabbb" NO-ERROR.

MESSAGE ERROR-STATUS:ERROR SKIP ERROR-STATUS:NUM-MESSAGES
VIEW-AS ALERT-BOX INFO BUTTONS OK.

FIX:

The workaround is to execute the CREATE statement on a scalar variable, then assign the scalar variable to the array element:

DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO EXTENT 15.
DEFINE VARIABLE hTmp AS HANDLE NO-UNDO.

CREATE BUFFER hTmp FOR TABLE "aaabbb" NO-ERROR.
ASSIGN hBuffer[1] = hTmp.

MESSAGE ERROR-STATUS:ERROR SKIP ERROR-STATUS:NUM-MESSAGES
VIEW-AS ALERT-BOX INFO BUTTONS OK.