>I've been trying to get my app to close using the "X". I've read several messages in the forum about the On Shutdown but I am still confused.
>
>In my main program I issue ON SHUTDOWN DO ONShutdown, I also issue a read events. After the READ EVENTS, I have some clean up code and then QUIT.
>
>ONShutdown sets a couple of variables for the clean up code and then I issue a CLEAR EVENTS.
>
>The Top Level Form closes but the app is still running.
ON SHUTDOWN does not work with top-levels, only the main vfp _screen. QUIT doesn't either. TLs are different.
With TLs, basically you can divide your closing code between TL's Queryunload and Destroy. You can put the CLEAR EVENTS in either, but earlier code should go in Queryunload.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.