Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Array as Parameter
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00005709
Message ID:
00005716
Views:
35
>>
>>the normal pass by reference works for me.
>>RetVal = MyFunction(@aArray1, @aArray2)
>
>I am passing the array from within an object. When I use @this.array it tells me the alias this does not exist.
>
>Also, for clarification, on the function side, how do you accept the passed arrays. I am passing 2 arrays and one non-array variable. Thanks for the time.
>
>John

if the array is a property in an object, you'll need to do the following
declare paTempArray[alen(this.array)]
=acopy(this.array,paTempArray)
RetVal = MyFunction(@paTempArray,...)

just say lparameters aPassedArray1, aPassedArray2, cOtherValue. in this code, aPassedArray1 references the array paTempArray in the calling program. of course, when you're done, you'll have to make the changes to this.array from paTempArray....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform