Re: win32lib: Munafa Accounting Package

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thanks Pete,

Pete Lomax wrote:
> 
> 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.
> 

I am sure you understand 
1. that the code is big - over 21,000 lines already, with some of it being
embarassingly repetitive (but I am still learning & wouldn't want to misguide
other newbies on an open forum),
2. that this type of code is more owner-need-based & custom-designed than
intellectual/educational (like the extra pockets in a travelling salesman's
shirts, trousers, jacket), hence the owners may not want to disclose the source
at such an early stage of development,
3. that, even then, seniors with a broader knowledge of the language will be
able to quickly understand the newbie-but-handicapped programmer's use of syntax
& logic flow without access to the source code (that's primarily why I
contributed the Munafa demo at this time and not later).

Given the above, I am sure that all of us freshers are grateful for the patience
& help from the seniors in this forum. The occassional ragging, teasing &
admonitions are all part of the learning process, I guess, and shouldn't drive
away the true, persistent learner. Euphoria, because of its people, is truly
turning out to be "easier than BASIC, more powerful than C".

Regarding the example you have cited below, I see that you have declared the
variables as local integers, not global or private constants. Then you have
initialized them within a procedure. Now, my questions:

1. destroy() in this case would remove the variable & make it inaccessible the
next time the user wants the same window. E.g. user searches for some text,
closes the window, does something else without leaving the program & again comes
back to search for some other text. Since closing the search window has already
destroyed the window variable, how is the local variable (search window)
declared/created again when required?

2. Local variables (in all include files) get created at program start using up
lots of memory (a start-up of the Munafa demo with Windows Resource Meter active
will show that). Or is there some other way around? You have mentioned .ini file,
a little more guidance on how to implement?

3. If the variables are declared as private, how does another procedure 
access them? E.g. a user-data-change in one variable (say Bill Number field)
triggers an onChange event which should change the data displayed in other
fields/variables (Debtor, Products, Amounts, Totals, etc.). The changed variable
itself may be accessed with the "self" parameter but what about the numerous
other variables?

> I often code something like the following:
> 
> }}}
<eucode>
> 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
> <font color="#330033"></eucode>
{{{
</font>
> 
> (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.)
> 

Basically my problem, at this stage, is accessing the relevant variables as and
when required instead of gobbling up memory by loading everything at program
start.

Thanks again for your patient guidance.
Regards.
Anando

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu