Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ON SHUTDOWN question
Message
 
To
03/10/2002 13:56:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00707422
Message ID:
00707674
Views:
13
No ON SHUTDOWN will not interrupt the running code unless you allow some event to be processed that will shut down VFP. If your code allows an event to shut down VFP then the shut down will occur and your code will NOT continue.
* 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.
>So my question is, will the running event finish before the clear event that was executed in my on shutdown procedure is executed ?
>
>Thnaks
>
>Xavier
>
>>>Xavier,
>>
>>VFP is NOT multithreaded so your ON Shutdown will NOT fire while other code is running unless the code that is running issues a DoEvents() function call.
Previous
Reply
Map
View

Click here to load this message in the networking platform