Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Arrays in Objects
Message
 
À
19/02/2002 08:15:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00621830
Message ID:
00621997
Vues:
26
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform