Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing class array properties to methods
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00332569
Message ID:
00332980
Vues:
8
>>Hi gang,
>>
>>I have a custom class in which I've defined an array property. I now want to pass that array, BY REFERENCE, to a method in the same class which updates that array, similar to the following:
>>
>>THIS.MyMethod( @THIS.MyArray )
>>
>
>Can't tell you why, but as you found, this doesn't work. Copy the array property to a local array first, and then pass that:
>
>=ACOPY(THIS.Array, laNewArray)
>THIS.MyMethod(@laNewArray)

That's a good idea -- that way I could populate laNewArray with either an external array OR the contents of THIS.MyArray based on conditions, and THIS.MyMethod wouldn't care. Of course, then I'd have to re-populate the real array once the method was complete...

I like it! Thanks Erik...
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform