Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array parameter
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00720625
Message ID:
00720628
Views:
10
This message has been marked as the solution to the initial question of the thread.
Hi Einar,

You cannot pass object property by reference. Using local array is the only way to pass array property to the function. The alternatives is to pass object reference and let function to acces any properties it needs. It could be object itself or some other object with array property.
* Pass reference to the object itself
f(this) 
* Pass reference to the object with array property
f(this.oAx)   && oAx is an object with Ax array property 
However in those cases your function should expect object not array as parameter.

>Hi,
>I like to send an array as parameter to a function:
>
>function f(aArr)
>x=aArr[1]
>endfunc
>
>If I do f(this.aX) I get "File 'aarr.prg' does not exist."
>
>If I do f(@this.aX) I get "Alias 'THIS' is not found."
>
>If I do
>ACOPY(this.aX,aP)
>f(@aP)
>the function works OK.
>
>Is there a better way to do this?
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform