Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning multiple values form a function
Message
De
03/05/2000 13:03:04
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Returning multiple values form a function
Divers
Thread ID:
00365646
Message ID:
00365646
Vues:
58
Hi to all,

Is it possible to return many values from a function or a procedure. I tried to return an array which would contain all the values I need but it didn't work, I only got the last value.

The code I tried was something like this:

FUNCTION calculate(list of parameters)
bla bla bla
dimension taReturn(3)
taReturn[1] = lnvalue1
taReturn[2] = lnvalue2
taReturn[3] = lnvalue3

return taReturn

ENDFUNC

and in my form I did something like this:

declare taAnswer(3)

taAnswer = calculate(list of parameters)

wait windows str(taAnswer[1])
wait windows str(taAnswer[2])
wait windows str(taAnswer[3])

All 3 wait windows gave me the same value which is lnvalue3 from the function.


TIA
Diane Robitaille eng.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform