Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning multiple values form a function
Message
From
03/05/2000 20:19:17
 
 
To
03/05/2000 13:03:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00365646
Message ID:
00365881
Views:
17
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform