Dear all:
I would like to do procedure/function once main form showed. both of inner/outer definition of window/end window fail.
Could anyone provide suggestion.
Best Regards
chen min
Hi Chen,
If I am not mistaken, your problem is about the control of UI (User Interface). Basically you should plan ahead of the interface. Add more controls as you needed and don't confine on init procedure only. Please explore the samples of HMG that comes along with the distribution. From there you would see the basic implementation and as you go along and become familiar with each control's behaviour. You would learn the tricks. What you need right now is more patience and determination.
With regards to your posted code (.rar file), it seems that you are attempting to send something over the Comm Port. Anyway on init procedure can be use in a variety of ways such as:
(1) Open a set of tables or database
(2) Generate splash screens
(3) Or do nothing at all simply display the main window and many more....
In the .prg file from the .rar file, I think instead of using on Init to open the comm port, it would be much better to add some buttons to handle the procedure that you want to run. By using various controls such as Buttons, Checkboxes with on change event you can fire up your procedures easily.
Another example is that when you use button control with caption "Send" that's the time you open the comm port and if it is sucessful, that's the time you can begin to transmit.
I hope that you get the principles.
Another thing is from your posting:
If you use files from the network, at least make a permanent drive mapping on the workstation. Then put the database filename in a private or public variables. Example:
dbThao := "G:\GDICH1\HT_HS\DBFS\thao"
dbDm2 := "P:\HD\dm2"
IF FILE( "&dbThao" + ".dbf" )
* do your code here *
endif
IF FILE( "&dbDm2" + ".dbf" )
* same here
endif
USE ( dbThao ) INDEX ( dbThao ) ALIAS THAO SHARED NEW READONLY via "DBFCDX"
Like that would be much easier to maintain and to edit... Well anyway it just a suggestion and there are many ways to achieved the same. In the end its your call my friend....
Regards,
Danny