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
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