Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Struct.vcx cMembers
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00546561
Message ID:
00548928
Vues:
15
>Hi Ed,
>
>>typedef struct
>>{
>> ADDR_REC stack[10]; /********** record stack **********/
>>} ZIP4_PARM;
>
>First of all you need to create a structure class for a single ADDR_REC which contains all members from the typedef of ADD_REC. Then you can define ZIP4_PARM as follows:
>
>DEFINE CLASS ZIP4_PARM AS Struct
>  cMembers = "ADDR_REC o:stack"
>  DIMENSION stack[10]
>  PROCEDURE INIT
>    LOCAL lnStack
>    FOR lnStack=1 to 10
>      THIS.stack[lnStack] = CREATEOBJECT("ADDR_REC")
>    ENDFOR
>  RETURN DODEFAULT()
>ENDDEFINE
>
>You can access memebers like this: oZIP4Parm.stack[3].cSomeMember
>
>If you do know C/C++, you should consider writing a FLL to access these API functions that require such structures. Struct was designed to ease the use of structures for VFP developers, not to make structures fast.
>
>Christof

Christof,

Thanks for the help. I was in the process of slowly figuring this out by re-reading the last pages of Struct.doc a couple of times :-)

When you say “Struct was designed to ease the use of structures for VFP developers, not to make structures fast” I assume that you are suggesting that I will take a big performance hit using the Struct Class. The API that I need to call is to clean up mailing lists and so the getstring() and setstring() functions would have to be called for each record. This could be 1000 to 100,000 records or more.

Rather than writing an FLL in C++, since there are just a limited number of API functions, wouldn’t it be easier to just build the string to pass manually and then, using VFP Low-Level File functions, to read the string after the API has worked on it? Wouldn’t this probably be just as fast as a C++ FLL? Since I don’t know C++, I know that it would be easier :-)

Ed
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform