Consultor Eletrônico



Kbase P129730: Nested IF functions can return wrong datatype
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   20/03/2008
Status: Unverified

FACT(s) (Environment):

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

SYMPTOM(s):

Using nested IF functions

Return value for IF determined by dynamic references (ie: DYNAMIC-FUNCTION, buffer-field:BUFFER-VALUE)

IF function does not return the datatype of the dynamic reference

One of the following occurs:

Value returned gets converted to different datatype

Runtime error occurs related to incompatible datatypes

CAUSE:

This is a known issue.

The datatype returned by the IF function will be determined at compile time, and the datatype returned is based on the datatypes of the expressions used.
The compiler can not determine the datatype for dynamic references and will ignore such references when determining the required datatype to return.
As a result issues occur if the datatype of the dynamic reference allows a wider range of values than the datatypes the compiler is aware of.

FIX:

Workaround:
Wrap the dynamic reference in a cast function for the appropriate datatype.