>Is there any way to pass an array from a program to a function, then have the function to update the array and pass it back to the original calling program? I've tried several things and I'm close but no cigar! Below is an example of my attempt to do this. Can someone steer me in the right direction?
>
>*----------------------------------------------------
>PROCEDURE Test1
>*----------------------------------------------------
>LOCAL laArray1, laArray2
>
>DIMENSION laArray1[1,5]
>DIMENSION laArray2[1,5]
>
>laArray1[1,1] = 'A'
>laArray1[1,2] = 'B'
>laArray1[1,3] = 'C'
>laArray1[1,4] = 'D'
>laArray1[1,5] = 'E'
Test2(@laArray1)
acopy(laArray1,laArray2)
>laArray2 = Test2(@laArray1)
>
>SUSPEND
>
>RETURN
>
>*----------------------------------------------------
>FUNCTION Test2
>*----------------------------------------------------
>PARAMETERS taArray
>
>DIMENSION laArray3[1,5]
>
>laArray3[1,1] = taArray[1,1] + 'A'
>laArray3[1,2] = taArray[1,2] + 'B'
>laArray3[1,3] = taArray[1,3] + 'C'
>laArray3[1,4] = taArray[1,4] + 'D'
>laArray3[1,5] = taArray[1,5] + 'E'
>
>SUSPEND
>
>RETURN laArray3
>*----------------------------------------------------
>
>In the FUNCTION Test2 I do a suspend and the data in laArray is what I expected. But when I get back to the PROCEDURE Test1 all the elements of laArray2 are filled with 'AA' which is what is in the first element of the laArray3 array.
ramil
~~ learning to stand still