Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return Multiple Values From a UDF
Message
De
21/01/2005 12:02:53
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
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:
00979325
Vues:
17
>To All:
>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. I have thought about casting and concatenating the values to a single string then returning that and parsing it when needed but I know there has to be a 'cleaner' way to accomplish this.

Since you didn't say whether the values to return are in any way connected to parameters, or does the routine need parameters at all, here's a version of the previous solutions which returns an object:
oReturn=myudf()
?oReturn.value1
?oReturn.value2

procedure myudf
oRet=createobject("empty")
AddProperty(oRet, "value1","first value")
AddProperty(oRet, "value2",datetime())
return oRet

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform