Shut down a running app

The place for peer-to-peer support for VPM Enterprise 9.1, our latest framework.

Shut down a running app

Postby btiguy » Wed Jan 31, 2018 2:00 pm

I have asked this before, a few years ago. I have written a shutdown routine. If my app is idle for X number of minutes, the app needs to shutdown. If the user has opened a form and started making data entries and then leaves the application, the timer kicks in and tries to shut down, but gets a VFP message that it can't shut down. I don't care if data is lost, at that point. I just want my app to exit. Don't know how to deal with the message. Any thoughts?
TIA
Don
btiguy
 
Posts: 455
Joined: Mon Jun 21, 2010 4:03 pm

Re: Shut down a running app

Postby stecenko » Wed Jan 31, 2018 5:51 pm

You might be able to call the restore method of the form. That's supposed to undo any unsaved entries and let you release the form.

I'm not sure how it would work with a one-to-many if there are unsaved child transactions. And it won't work if you are sitting on messagebox.

Where do you have this shutdown method that the timer is calling?
Richard Stecenko
Interactive Computer Services Inc.
Victoria, British Columbia
204.453.2052
stecenko
 
Posts: 822
Joined: Mon Jun 21, 2010 8:06 pm
Location: Saanich, British Columbia

Re: Shut down a running app

Postby btiguy » Sun Feb 04, 2018 12:53 pm

Thanx. I start a timer in each form when initiated and re-set the start time in the form if a key is pressed. If the timer reaches the idle time, say 10 minutes, I issue a "quit" command. That's when the message appears that FP can't quite if the form has uncommitted changes. I'll try the restore method. That makes some sense. I'm not concerned if the use loses data. Usually the idle time is long enough to not be a problem, such as 30 minutes, etc.
TIA
Don
btiguy
 
Posts: 455
Joined: Mon Jun 21, 2010 4:03 pm

Re: Shut down a running app

Postby stecenko » Sun Feb 04, 2018 1:27 pm

You can have the timer call a custom method in proapp that will cycle through all the active forms and call each restore method.

Then loop through all the active forms and call the release method.

On page 128 of the Technical Reference Manual is info on the active Forms array. See column 2.

You can then check the active forms array to be sure it is empty, then you can quit.

If it isn't empty, then write the form name (column 15) to a text file and display a message (Tried to quit but couldn't). You can look at the text file and identify those forms that don't restore/release properly and figure out why. There might be modal forms that won't behave properly, I don't know; but if you get this to work most of the time that's an improvement.
Richard Stecenko
Interactive Computer Services Inc.
Victoria, British Columbia
204.453.2052
stecenko
 
Posts: 822
Joined: Mon Jun 21, 2010 8:06 pm
Location: Saanich, British Columbia

Re: Shut down a running app

Postby wftdata » Mon Feb 05, 2018 10:11 pm

I have a manual SHUTDOWN Routine that displays a form with a timer. It states you have 1 minute to log off! It then calls "_SCREEN.oApp.ExitAppication()". If the user doesn't log off they are blown off system. I haven't had any issues using this. It should work with your routine. Give it a try.

Regards,

Bill
wftdata
 
Posts: 92
Joined: Thu Jun 23, 2011 8:42 pm
Location: East Moriches, NY 11940


Return to VPM Enterprise 9.1

Who is online

Users browsing this forum: No registered users and 6 guests

cron