Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return Multiple Values From a UDF
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00979276
Message ID:
00979284
Vues:
11
Hi Woody.

>IS there a way in VFP to return multiple values from a User Defined Function? I don't want to use an Array, then I have to pass by reference and I am trying to avoid that.

Pass an object. The UDF can then set whatever properties it wants and the caller can then examine the values of these properties. You can even create the object on the fly:
loParameters = createobject('Empty')
addproperty(loParameters, 'ReturnValue1', '')
addproperty(loParameters, 'ReturnValue2', 0)
do MyUDF with loParameters
? loParameters.ReturnValue1
? loParameters.ReturnValue2

function MyUDF(toParameters)
toParameters.ReturnValue1 = 'Howdy'
toParameters.ReturnValue2 = 5
return
Doug
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform