Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing object properties by reference
Message
 
 
To
23/04/2001 14:45:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00498684
Message ID:
00498691
Views:
9
>I have created a container sub-class which has an array property. I want to pass a reference to this array to a method in an embedded object. However, when I try to use the @ to reference the source array it doesn't work. For example,
>
> this.parent.lstSelected.SetRowSource(@this.parent.aInitialList)
>
>...does not work, but this does:
>
> acopy(this.parent.aInitialList, aTempArray)
> this.parent.lstSelected.SetRowSource(@aTempArray)
>
>Unfortunately this creates other problems and I'm trying to keep the code as simple as possible anyway.
>
>Q: Does anyone know how to pass an object property by reference?
>
>Thanks.

You can't. It's that simple. You either have to pass the object itself or copy the array to a variable and pass that (which you are doing).

What problems does passing the array as a variable create? Many developers do this.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform