* Some program DO stuff * The user clicks on the close box and some more stuff && this line will run because VFP will not process the user's click while code is running DoEvents() && allows the user's click on the close box to attempt to shut down VFP this will fire ON SHUTDOWN Next command && will not execute if the previous DoEvents allowed VFP to be shut down
* Some program DO stuff and some more stuff * User clicks on the Close box * The user's click will not have been processed by VFP yet as this code is currently running so the next line will run Next command *The code is finished so immediately after returning the user's click will be processed and ON SHUTDOWN will be fired>Yes it is not Multithreaded but ON SHUT DOWN will interrup the running event.