Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning an array from a function
Message
De
03/04/2002 06:24:49
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00639966
Message ID:
00640262
Vues:
17
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform