Consultor Eletrônico



Kbase P71941: Array assignment feature works different than documented
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/15/2004
Status: Unverified

FACT(s) (Environment):

Progress 9.1D

FACT(s) (Environment):

OpenEdge 10.x

SYMPTOM(s):

Array assignment feature works different than documented

No error even ** Left-hand side of assignment statement cannot be an array. (369)

CAUSE:

Documentation bug# 20040312-011

FIX:

The following code works fine even according to the documentation it should not.
The result is that all elements of the array get the same value assigned if you assign one value to the whole array.

DEF VAR carr AS CHAR EXTENT 3.
DEF VAR iarr AS INT EXTENT 3.
DEF VAR i AS INT INITIAL 1.
DEFINE FRAME a WITH SIZE 77 BY 7 .

carr = "test" .
iarr = 7 .
carr [2] = "No" .
iarr [2] = 5 .

DISP carr iarr WITH FRAME a.

The reason for that behavior is the same as that like documented for the initial value:
If you do not supply enough values to fill up the elements of the array,
Progress puts the last value you named into the remaining elements of
the array.