>(1) In the beginning of CleanUp you reset the On ShutDown
>If you return then CleanUp is not longer the on('shutdown')
>
>So, returning from CleanUp without touching the On Shutdown prevents quiting foxpro
>
>(2) I see a Clear Events - If you are in runtime - the code after that will not be executed
>
>I have something like this
>
>
>
>if( not ok to shutdown )
> return
>endif
>
>
>on shutdown
>
>if( runtime )
> clear events
>else
>
> quit
>endif
>
>
>The runtime after read events
>
>
>...
>on shutdown do cleanup
>
>read events
>on shutdown
>
>quit
>
>
>ps: if you set your screen.controlbox on, you can debug it
>
Re ps - Yes, I did a while ago.
If it's not broken, fix it until it is.
My Blog