Consultor Eletrônico



Kbase P115750: 4GL/ABL: Errors (223) and (196) using NUM-ENTRIES function in a CASE statement expression within an
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/30/2008
Status: Verified

SYMPTOM(s):

4GL/ABL: Errors (223) and (196) using NUM-ENTRIES function in a CASE statement expression within an ABL CLASS

** Incompatible data types in expression or assignment. (223)

** <program> Could not understand line <number>. (196)

** Could not understand line 12. (196)

Errors are generated when compiling or checking the syntax of a CLASS definition code similar to the following:
CLASS TestCaseStatement:
DEFINE PRIVATE VARIABLE cVar AS CHARACTER.

CONSTRUCTOR PUBLIC TestCaseStatement ( INPUT ipc AS CHARACTER ):
cVar = ipc.
testCharCase(cVar).
END CONSTRUCTOR.

METHOD PUBLIC VOID testCharCase( INPUT c AS CHARACTER):
CASE NUM-ENTRIES(c):
END CASE.
END METHOD.
END CLASS.

FACT(s) (Environment):

All Supported Operating Systems

CAUSE:

Bug# OE00126155

FIX:

Upgrade to OpenEdge 10.1B or later. If upgrading to OpenEdge 10.1B or later is not feasible, then a workaround is to define an intermediate integer variable to store the result of the NUM-ENTRIES function and use that variable in the CASE statement expression. For example the following version of the above ABL CLASS definition code resolves this issue:
CLASS TestCaseStatementB:
DEFINE PRIVATE VARIABLE cVar AS CHARACTER.

CONSTRUCTOR PUBLIC TestCaseStatementB ( INPUT ipc AS CHARACTER ):
cVar = ipc.
testCharCase(cVar).
END CONSTRUCTOR.

METHOD PUBLIC VOID testCharCase( INPUT c AS CHARACTER):
DEFINE VARIABLE iVar AS INTEGER NO-UNDO.
iVar = NUM-ENTRIES(c).
CASE iVar:
END CASE.
END METHOD.
END CLASS.