Re: win32lib: Munafa Accounting Package
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jul 05, 2005
- 539 views
On Mon, 04 Jul 2005 14:09:51 -0700, Anando Banerjee <guest at RapidEuphoria.com> wrote: >Anando Banerjee wrote: >> >> Am unable to disclose source code at present. Fair enough, however expect less helpful replies) I recall last year having a problem with my closed-source print preview (the subscripted compound assignment issue, ie a[i]+=, which was fixed in 2.5.) I spent about three days hacking the program down to the minimum that would still exhibit the problem. My point should be clear: if you (or your employer) have just spent months and months working on something, so you don't want to give away the source, you may need to be prepared to spend several days creating something which demonstrates the problem, that you are prepared to release. >As you can the program starts off with a huge bunch of local constants hogging >loads of memory. >constant SomeWindow=create(Window, ...) >constant SomeControl=create(EditText, ...) >and so on. > >The actual project I am working on is even bigger and will have lots more >user-interactive windows. > >My question is: how can I reduce the number of local constant windows at >start-up >and create only the constants (windows) the user clicks for. When the user >exits the >window, how can I release the constant until it is required again? > >destroy() removes the constant all together, closeWindow() keeps it in memory. >Is there something else I am missing? > I often code something like the following:
integer initFIND, Fwin initFIND=0 integer flab, findtext, rlab, replacetext, ... global procedure Find() if not initFIND then Fwin = create( Window, "Find", 0, Main, 100, 50, 523, 190,0) flab = create( Label, "Find ", 0, Fwin, 8, 15, 70, 24,0) findtext = create( ComboDropDown, "", 0, Fwin, 80, 11, 305, ... initFIND = 1 end if
Primarily, I do so in the possibly mistaken belief I shave a few fractions of a second off load time, but correctness of motive aside, I do it, and it works. (Another reason I have done that is to delay load of the .ini file until later, so I can reference all the various globals immediately each .ini setting is realised.) Perhaps you could also do
destroy(Fwin) initFIND=0
If your app is so large it really does need to keep memory usage down. I cannot claim it will help, but it seems to be worth a try. Regards, Pete