Page 1 of 1
suggestions to write programs
Posted: Wed Apr 21, 2010 10:35 am
by l3whmg
Hello everyone.
I would like to know your opinion about the organization that I want use to write my programs.
In particular, I refer to the use of forms 'child' (or 'standard').
As you can see, I use a hidden label (FormStatus) to determine if the form is already committed or is free.
Because I have used this method?
Example: I have a table of countries and one for people.
The user could access the data in the countries table, both from the specific menu that another program (people insertion) but simultaneously.
The use of this label (but could also be a textbox field) allows me to check if the form is free, so I can use it, or committed by other process.
I think I can't use the same form from different processes or call: If this possibility exists that you could tell me?
What do you think? there are viable alternatives that my mind can not see?
Within the compressed file, I included both source and executable and a table.
Thanks for your help.
Re: suggestions to write programs
Posted: Wed Apr 21, 2010 1:33 pm
by Rathinagiri
Thanks for sharing Luigi. I will check and revert back.
Re: suggestions to write programs
Posted: Wed Apr 21, 2010 1:39 pm
by l3whmg
Hi Rathinagiri,
many thanks. I'll wait your opinion.
Best regards
Re: suggestions to write programs
Posted: Wed Apr 21, 2010 1:40 pm
by Rathinagiri
Nice work Luigi.
I want to ask one question. Why do we need a hidden variable? Can't you use iswindowdefined()?
Re: suggestions to write programs
Posted: Wed Apr 21, 2010 1:40 pm
by esgici
l3whmg wrote:
What do you think? there are viable alternatives that my mind can not see?
Within the compressed file, I included both source and executable and a table.
Ciao Luigi
Thanks to share
Surely, your program have many thing to help our friend in order to deeply understand and use HMG
Saluti, regards
--
Esgici
Re: suggestions to write programs
Posted: Wed Apr 21, 2010 3:06 pm
by l3whmg
Ciao AMICI!
Rathinagiri, I don't use IsWindowDefined because this function tell me only if a form "is defined" and all my forms are always defined.
My POV it's different: I need to know if a form is committed in other words if in this moment I've already loaded data.
To test this solution you must click on "Manager->Record", select a valid Code (ex. REC1), press enter and minimized this form; now, click on "Other->Form", find a record with button and ON this form click "Add" or "Edit". You can't use the form because it's committed with other record!
Esgici: if this sample can be an example and HMG want include inside standard example, you can do! I'm working on a evolution (little) and I can share new version of the same.
Best regards
Re: suggestions to write programs
Posted: Wed Apr 21, 2010 4:02 pm
by esgici
Hi Luigi
How it will be better if you use ALL your comments, variable names, even field names and data in English

So we can understand and will comment more easier
Regarding "including inside standard examples", I can't say anything about that; you know, this will be only decision of Maestro

But no problem, since you had sent it to forum, it's already between HMG samples
Saluti
--
Esgici
Re: suggestions to write programs
Posted: Wed Apr 21, 2010 8:35 pm
by l3whmg
Hello everyone.
Esgici thanks for your attention and I apologize for leaving comments in Italian, making it difficult to follow the source

I hope that now it is easier to follow my thought!
What you find attached to this post is the widespread application of the solution that I proposed.
To verify it works just follow these steps:
1) from the main menu, select "MANAGER" and then "RECORD" (p002win form is open)
2) enter "REC1" in the TEXTBOX near to the LABEL "Code" and press ENTER (this reads the record and locks it)
3) minimize this form
4) from the main menu, select "OTHER" and then "FORM" (p100win form is open)
5) click on the button marked with binoculars (p003win form is open)
6) click on "ADD" or "EDIT". At this point a message (
the form p002win is filled) will appear warning that the form is committed. In fact, you're using it but it's minimized and contains data from another record. Else if you press the button "SELECT" you return to form "p100win" with some data.
I tried this solution having seen the capabilities of some ERP/programs (before losing my job

).
I think it important to develop programs that facilitate the end user so we can offer solutions built with the XBase language (repriced - at least in Italy - this language and its potential), compiled with Harbour
and using the great work of Roberto
I hope now my information is more understandable.
Best regards
Re: suggestions to write programs
Posted: Wed Apr 21, 2010 8:43 pm
by esgici
Grazie Luigi
Surely now I'll follow easier
Saluti
--
Esgici