Thanks Agnes
Yes, I've just re-read the help and noticed that it only sets the correct dimensions on a new (or I expect .F. set array?), so what I've done is just type:
DIMENSION laArray(1, 1)
before the 2nd ACOPY and that seems to work also.
Still a bit strange though!
Cheers
Kev
>>Hi
>>
>>OK, I have a property (which is an array) in my object which I ACOPY into a local array, I thought that ACOPY increases the elements in a destination array to match the source array, this works fine the first time, but when I want copy another property (array) into the same local array, it errors.
>>
>>Sample code:
>>
LOCAL laOutput(1, 1)
>>
>>*Copy first array (this works fine)
>>=ACOPY(this.aArray1, laOutput)
>>
>>*Copy second array (this errors)
>>=ACOPY(this.aArray2, laOutput)
>>
>>
>>
>>this.aArray1 is [6, 9] and this.aArray2 is [7, 9].
>>
>>Any ideas?
>>
>>Thanks
>>Kev
>
>Hi Kevin,
>acording to Help dimension of DestinationArray is changed on if DestArray not exists.
>But this is not very clear.
>ACOPY is a little bit tricky because it seems to work like
>
>FOR lnloop = 1 TO ALEN(SourceArray)
> DestArray(lnloop)=SourceArray(lnloop)
>ENDFOR
>
>so you better do
>
>DIMENSION laOutput(ALEN(this.aArray2,1),ALEN(this.aArray2,2))
>=ACOPY(this.aArray2, laOutput)
>
>
>Agnes