Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling DECLARE repeatedly
Message
From
13/01/2010 07:24:46
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01443625
Message ID:
01443639
Views:
59
>>>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
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform