Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning an array from a function
Message
From
03/04/2002 06:24:49
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00639966
Message ID:
00640262
Views:
16
>>But I have to use VFP6...Is there any way using this version ?
>
>Also take a look on KB article Q188255 "ArrayCom.exe Passing Array To COM DLL by Reference", which shows how to pass and return array from COM server.

I've worked with passing an array to and from .dll servers in VFP 6. To say that they are unpredicatable is an understatement. If you are not exteremely careful in doing so, you will lose the data in the array, particularly if you redimension the array. Doing so has a nasty habit of resetting all the elements in the array to .F..

In general, your best strategy is to set the size of the array to the largest expected size when passing it in, then working with the array on an element-by-element basis. Certain operations that fill the array at once (COPY comes to mind) may be safe, but olthers are not.

I don't have my notes on the subject in front of me, but if there's interest, I'll pull them out.
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform