Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning arrays
Message
De
24/08/1998 12:56:09
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00129242
Message ID:
00129368
Vues:
30
>>>Is there a way in fox to return or pass an array? When I return an array I only get the first element. (weak) :(
>>>
>>>Eric K.
>>Eric,
>>Arrays should be passed by reference. Default is by value and you don't need to change it, just add an @ in front of the var or call with "with".
>>do myprg with myArray && Passed by reference
>>=myprg(myArray) && Passed by value - only first elem value
>>=myprg(@myArray) && Passed by reference
>>Return is the same way but this is more complicated because if not defined public array would be out of scope (implicit release). Better define in caller level.
>>Cetin
>
>It turns out that RETURN does not accept & or @. It does however accept a name string ie. (somename) But, for what I'm attempting to do I think the best thing is to pass the array by reference to the OLE server then have the server just return .T. or .F., this way if I see .T. then I know the array memory space has been acted upon by the server, then life goes on as usual...
>
>Eric K.
Eric,
I really don't know what would happen with OLE servers. OLE server or not return wouldn't work for arrays. Only thing that might be a clue, for passing arrays to WINAPI structures, I remember something like to pass all array elements transposed to one string and parse on the other hand, on return reparse to array. I don't work with OLE servers and WinAPI much so all might be wrong info too, pls check.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform