Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing and returning arrays
Message
De
19/03/2002 14:01:04
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00633588
Message ID:
00634587
Vues:
19
I don't have VFP7 so I can't test for answer to my question.

After you run myFunc(), are aTemp and aTest separate arrays or separate references to the same array? In case I've phrased that badly, if you modify an element of aTemp, will that have any affect on aTest and vice-versa?

Thanks.....Rich

>>In VFP7, you can return an object's array from an object's method, but you can't do that from a plain old .PRG style function.
>
>You can but such arrays must be in scope after the call. The only way to achive that is to use PUBLIC array. Here's a code
PUBLIC aTest[1]
>aTemp = myFunc()
>?aTemp[1], aTemp[2], aTemp[3], aTemp[4], aTemp[5]
>
>FUNCTION myFunc
>DIMENSION aTest[5]
>aTest[1] = "Some"
>aTest[2] = " values"
>aTest[3] = " can"
>aTest[4] = " be"
>aTest[5] = " returned"
>RETURN @aTest
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform