Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to quit application

Status
Not open for further replies.

steve3739

Programmer
Jul 5, 2002
32
US
Hi all,
After looking at the FAQs and prior posts regarding the best way to quit an application, the following code seems like a simple way to go:

***Simplified Main Program***********************
on error do errorhandle
on shutdown do confirmquit && asks user if they really want to quit
do menu1
do form1
read events

***shutdown OR menu choice OR form button calls confirmquit.prg which issues a "clear events" command, and program control returns here...

on error
on shutdown
on key
clear all &&clears all variables and windows (but leaves project manager if open)
close databases all
if _vfp.startmode=0
_screen.windowstate=2 &&maximized
set sysmenu to default
set status bar on
endif
cancel
******************************************
Before I start making changes to my forms and prgs, does this look like a clean way to quit? Or am I missing something important?

Thanks for any comments or suggestions.
Steve - occasional programmer:)
 
It's my view (and that of a lot of UI experts) that you shouldn't prompt for confirmation, except when undertaking very destructive actions. Ordinary actions should be reversible rather than prompted.

Tamar
 
In general I agree with you Tamar. You can usually hear me muttering "Stupid machine. Of course I'm sure I want to quit. I wouldn't have hit Quit if I didn't want to quit." whenever I hit one of these.

But I do think it depends on the environment. I don't know if it's Fox or me but a lot of systems I wrote are the sort that get turned on at 08:00 and stay on screen all day long. I put an "Are you sure?" into Quit because quitting is something they only do once a day.

In this situation, the extra wasted mouse click for "Yes" at the end of the work is better for them than having to reopen the app, enter their name, and enter their password if they close it by mistake during the day.

Geoff Franklin
 

Tamar,

It's my view (and that of a lot of UI experts) that you shouldn't prompt for confirmation, except when undertaking very destructive actions.

I agree with that. My point (above) was that you should prompt for dealing with unsaved edits, not for quitting in general.

The corollary is that it should be easy for the user to re-enter the application as close as possible to the point at which they accidentally quit.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top