Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling DECLARE repeatedly
Message
De
13/01/2010 07:38:03
 
 
À
13/01/2010 07:24:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01443625
Message ID:
01443640
Vues:
41
>>>>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".
>
>
>But you can also declare it when needed - In a .net world that would be lazy load or similar
>
>The first time it uses the function below which declares the api. Once declared the api has greater precedence than the function. Hence, the second time the api will be called instead of the function
>
>
>function zCreateNewZip(zipFileName)
>   declare integer zCreateNewZip in bszip string zipFileName
>   
>   return zCreateNewZip(m.zipFileName)
>endfunc
>
Very neat - hadn't come across that before. Pity that it's unlikely I'll get to use it......
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform