Consultor Eletrônico



Kbase P161539: LENGTH(characterVariable) function no longer compiles if characterVariable is an EXTENT variable
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/11/2010
Status: Unverified

SYMPTOM(s):

LENGTH(characterVariable) function no longer compiles if characterVariable is an EXTENT variable

** Only individual array elements are allowed in expressions or on the right-hand-side of non-array assignments. (361)

** An array was specified in an expression, on the right-hand side of an assignment, or as a parameter when no array is appropriate or expected. (361)

FACT(s) (Environment):

OpenEdge 10.2B
All Supported Operating Systems
OpenEdge Category: Language (4GL/ABL)

CHANGE:

Upgraded to OpenEdge 10.2B

CAUSE:

The behavior in OpenEdge 10.2B is the correct behavior.

The LENGTH() function expects an expression that resolves to a single character string as input.
An EXTENT variable consists of multiple values, and therefore is invalid input for the LENGTH() function.

FIX:

Depending on the use case:

1. If the goal is to process all elements in the extent variable, replace the LENGTH() function with the EXTENT() function. EXTENT(Variable) returns the number of elements in the array.

2. If the goal is to determine the length of a single element, qualify the variable name with the array subscript. This specifies which specific element of the array to use, which will be a single value.