Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning multiple values form a function
Message
De
03/05/2000 15:15:52
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00365646
Message ID:
00365747
Vues:
16
>>>OOPS.. thought we were talking about returning multiple variables from a FORM... but still, returning a string and parsing will work.
>>>
>>>Also, in reference to the arguments about an array not being in the right scope (ie its created in the function and then when you try to pass it back it is gone so you only get the first element), why not create the array outside the function and pass it by reference and then return it back again (@laArray[])? Just a thought.
>>
>>That's fine also. But if the array is declared PRIVATE in the calling program or higher, you don't have to pass anything, just reference it. I'm sure there's a lot of personal preference here that will determine how each individual would implement this. :-)
>
>Bill/Shawn,
>That's not really fine. You can't return a value by reference. VFP will choke on it.

Yeah. I tested this. Passing the array in by reference is ok of course. Then just a simple RETURN after manipulating the array is what I meant. I thought this is what Shawn meant too. Perhaps he meant an actual RETURN @MyArray.
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform