How to force on release event executed?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

How to force on release event executed?

Post by huangchenmin »

Hello everyone
there is a procedure whenexit() ,which for on release event.
I hope I can run exe file individual by parameter.
For example,missopd.exe ->normal running,missopd.exe 0 ->do onrelease and close missopd.exe
I had tried setproperty(),do events and fail.
PLS HELP!
Best Regards
Attachments
MissOPD.rar
(3.97 KiB) Downloaded 212 times
User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines

Re: How to force on release event executed?

Post by dhaine_adp »

Hi,

Please try including ON INTERACTIVECLOSE on your windows definition:

Code: Select all

 DEFINE WINDOW Form_MOPD;
                AT 08,176;
                WIDTH 885;
                HEIGHT 680;
                TITLE "¹w¬ù¥¼¦^ÃöÃh";                 
                ICON "Default";
                ON Init if(marg==NIL,LoadMIL(),just4Impt()); 
                ON release WhenExit();        
                ON INTERACTIVECLOSE WhenExit();  <<--- Add this line
                MAIN
WhenExit() is triggered on two places:

(1) ON RELEASE, when you do a domethod("Form_MOPD","Release") or Form_MOPD.Release
(2) ON INTERACTIVECLOSE also fires up WhenExit() when you click the Window Close box [x].

IMHO, you can code the exit procedure or application termination as follows



*******************************
function DestroyWindow() // because you declared this window as main, right?

DBCLOSEALL()
DeleteAllYourTempFile() // Your UDF to removed the temporary files used by the apps.
RELEASE ALL
RELEASE WINDOW ALL // this effectively terminates all window. anywhere in your code
// other than here, your application terminates if you issue this command so
// use it with caution
RETURN NIL
Regards,

Danny
Manila, Philippines
User avatar
srvet_claudio
Posts: 2224
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: How to force on release event executed?

Post by srvet_claudio »

Hi Huangchenmin

Change in your code:

Code: Select all

function just4Impt()
         MsgInfo("here in just4Impt()")
         Form_MOPD.Release
return
I hope have been useful.
Best regards,
Claudio Soto.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
srvet_claudio
Posts: 2224
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: How to force on release event executed?

Post by srvet_claudio »

Great Dhaine, very good explanation.
Thanks.
Best regards,
Claudio.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How to force on release event executed?

Post by huangchenmin »

dhaine_adp wrote:Hi,

Please try including ON INTERACTIVECLOSE on your windows definition:

Code: Select all

..................
RETURN NIL[/quote]
Thanks for your supports!
Great help to me.
Best Regards
chen min
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How to force on release event executed?

Post by huangchenmin »

srvet_claudio wrote:Hi Huangchenmin

Change in your code:

Code: Select all

............
return
I hope have been useful.
Best regards,
Claudio Soto.
Thanks for your supports
Simple and useful.
Best Regards
chen min
Post Reply