Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning multiple values form a function
Message
From
03/05/2000 15:15:52
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00365646
Message ID:
00365747
Views:
15
>>>OOPS.. thought we were talking about returning multiple variables from a FORM... but still, returning a string and parsing will work.
>>>
>>>Also, in reference to the arguments about an array not being in the right scope (ie its created in the function and then when you try to pass it back it is gone so you only get the first element), why not create the array outside the function and pass it by reference and then return it back again (@laArray[])? Just a thought.
>>
>>That's fine also. But if the array is declared PRIVATE in the calling program or higher, you don't have to pass anything, just reference it. I'm sure there's a lot of personal preference here that will determine how each individual would implement this. :-)
>
>Bill/Shawn,
>That's not really fine. You can't return a value by reference. VFP will choke on it.

Yeah. I tested this. Passing the array in by reference is ok of course. Then just a simple RETURN after manipulating the array is what I meant. I thought this is what Shawn meant too. Perhaps he meant an actual RETURN @MyArray.
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform