Consultor Eletrônico



Kbase P155500: NULL values causing entire assign statment to be set to null
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/6/2009
Status: Unverified

SYMPTOM(s):

NULL values causing entire assign statment to be set to null

If one of the values are set to null, the entire string ends up being null.

FACT(s) (Environment):

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

CAUSE:

Expected behavior

FIX:

When adding 2 or more variables and one of them is ? ( unknow) the result is unknown.
Replace the unknown values with blank or 0 depending on the data types.
Example.
DEF VAR v1 AS CHAR INIT ?.
DEF VAR v2 AS CHAR INIT "abc".
DEF VAR v3 AS CHAR.
v3 = ( IF v1 = ? THEN "" ELSE v1 ) + ( IF v2 = ? THEN "" ELSE v2 ).
Otherwise: v3 = v1 + v2 ends up ? ( unknown ).