Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Arrays in Objects
Message
 
To
19/02/2002 08:15:36
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00621830
Message ID:
00621997
Views:
14
Penda,

It is correct that properties cannot be passed by reference, they can by value but that doesn't help your array situation.

You can get the same effect by passing the object itself along with the name of the array property. Assume an object with an array property named MyArray. You can do this;
* some code inside the object with the array property
SomeotherObject.SomeMethod(THIS, "MyArray")
Now in the other object you would;
LParameters toObject, tcArrayName
WITH toObject
   FOR LnCnt = 1 TO ALEN(.&tcArrayName,1)
      .&tcArrayName(lnCnt) = "Blah"
   ENDFOR   
ENDWITH
RETURN
This works because you can pass objects around.
Previous
Reply
Map
View

Click here to load this message in the networking platform