Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling DECLARE repeatedly
Message
De
13/01/2010 08:32:10
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01443625
Message ID:
01443658
Vues:
49
>>>>>Hi,
>>>>>
>>>>>I have a routine that adds files to a .zip based on some 3P product (bszip). The code in this procedure has several DECLARE statements (e.g. "declare integer zCreateNewZip in bszip string zipFileName")
>>>>>Since this procedure (that Zips certain files) is called repeatedly, can it cause PC memory issues or some other side effects?
>>>>
>>>>Just declare them in your Main program once :-)
>>>
>>>I thought about it too but the downside is that if a user never calls this routine that zips files some memory is "wasted".
>>>
>>>Thank you for your suggestion, Borislav.
>>
>>Nope,
>>You only declare a functions that could be used somewhere.
>>It is the same you create your own function in some PRG and never call it.
>
>I didn't realize that. I thought the statement DECLARE actually loads the function into the memory. What confused me, I think, is that in the sample code that came with BSZIP they had a line CLEAR DLLS right before calling all DECLARE statements. I still don't understand the purpose of calling CLEAR DLLS before DECLARE or they are maybe not related.
>
>Thank you for your help.


(1) If they had CLEAR DLLS in their example they are of a dangerous kind

(2) Declaring is just a way to add a function to an internal table. It verifies that the function exists in that dll, then adds it to a table. When you call it, it does a lookup in its table to find the corresponding dll (and function) to call
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform