>Hi gang,
>
>I have a custom class in which I've defined an array property. I now want to pass that array, BY REFERENCE, to a method in the same class which updates that array, similar to the following:
>
>THIS.MyMethod( @THIS.MyArray )
>
Why do you need to pass the member array to a method of the parent class? It's already visible to the method...
You might try passing the name of the array, or checking to see if the passed parameter is null, and if so, assume that the member array is to be used.
>Doesn't work -- neither does removing the @ sign (the parameter shows as .F. in the method).
>
>This method MUST accept the name of another, non-property array as a parameter -- I can't assume automatic usage of THIS.MyArray in all cases. And, if I simply don't pass a parameter when I do want to use THIS.MyArray, then I don't have the array by reference -- or does that matter?
If you change a member array in a method of the object, the changes persist beyond the method call, because the array persists beyond the method call.
An alternative - why not pass an object reference in all cases, and have a member array in the object reference passed? IOW:
this.MyMethod(this) && references the local member array
LOCAL oParm
oParm = CREATEOBJ('Separator')
oParm.AddProperty('memberarray[1]')
* Populate the member array
this.myMethod(oParm) && references the same named member array in oParm
Procedure MyMethod
LPARAMETER toCarrierOfArray
* you now reference the array at all times as toCarrierOfArray.MemberArray[...]
*yadda, yadda, yadda
* copy the results back to another arrray if needed
>
>Any ideas would be greatly appreciated.
>
>TIA,