Consultor Eletrônico



Kbase P172754: Error 223 when using division expression as INTEGER function parameter
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/09/2010
Status: Unverified

SYMPTOM(s):

Error 223 when using division expression as INTEGER function parameter

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

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

Code is similar to:

vTitle = FILL(" ", (vPageWidth / 2 - ( length(vCompanyName) / 2 )))).

FACT(s) (Environment):

All Supported Operating Systems
Progress/OpenEdge Product Family

CAUSE:


Division calculations are performed internally with all the operands as DECIMAL; operands are converted if necessary. The result of an expression involving division is reported as DECIMAL. If the expression is supplied for an INTEGER function parameter, error 223 is raised at compile time.

FIX:

Assign the result to an INTEGER variable and use that variable as the function parameter. The ASSIGN statement will perform the necessary conversion from DECIMAL to INTEGER. For example:

DEFINE VARIABLE iFillLength AS INTEGER NO-UNDO.
iFillLength = vPageWidth / 2 - length(vCompanyName) / 2 .
vTitle = FILL("", iFillLength).