Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing and returning arrays
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00633588
Message ID:
00634288
Views:
21
>>>In VFP7, you can return an object's array from an object's method, but you can't do that from a plain old .PRG style function.
>>
>>You can but such arrays must be in scope after the call. The only way to achive that is to use PUBLIC array. Here's a code
PUBLIC aTest[1]
>>aTemp = myFunc()
>>?aTemp[1], aTemp[2], aTemp[3], aTemp[4], aTemp[5]
>>
>>FUNCTION myFunc
>>DIMENSION aTest[5]
>>aTest[1] = "Some"
>>aTest[2] = " values"
>>aTest[3] = " can"
>>aTest[4] = " be"
>>aTest[5] = " returned"
>>RETURN @aTest
>>
>
>Not true! The array doesn't even have to exist BEFORE you call the object's method. It will be created within the scope of the calling code as a local variable.

I was talking about PRG based function.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform