Information générale
Catégorie:
Codage, syntaxe et commandes
>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.
You can't return an array, you can send a blank array by reference, and modify it, and it will be available in modified for to the callling program. You can also just send multiple blank variables by reference:
store space(100) to lc1, lc2, lc3
?MyFunction(@lc1, @lc2m @lc3)
Then, have your function accept the 3 params and modify the local parameters within the function, and when you return, use the previously blank varibals for your purposes. Also, you can create a parameter object to pass around using multiple properties on that, or just another array property.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement