Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Gene Wirchenko
  Where is Gene Wirchenko?
 Kamloops
 Canada
 Gene Wirchenko
 Tags
Subject: RE: clear events
Thread ID: 395882 Message ID: 395895 # Views: 54 # Ratings: 3
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Tuesday, January 21, 2014 7:10:37 AM         
   


> Dear Vixens and Reynards:
>
> My understanding of clear events is that it functions as a sort of return statement. The docs state that, too.
>
> I have a test program where in a QueryUnload, I have a clear events statement. Because I already seen some weird event orders with grids, I have been tracking events more than usually. In this case, execution continues past the clear events statement. The should-not-happen message gets printed. This does not result in an error, but why is it happening?
>


Because "Clear Events" just tells the runtime to jump behind the current "Read Events" wait-state.
That way the code after the "Read Events" runs, for example in "main.PRG".
And if there is no new "Read Events" statement following, the custom code in "main.PRG" finally ends.

At that point, all currently existing objects do what their event sequence tells them to do, i.e. basically Destroy() of every Vfp base class is running, and objects based on Form additionally run their QueryUnload() before and Unload() after Destroy()



hth
-Stefan

ENTIRE THREAD

clear events Posted by Gene Wirchenko @ 1/20/2014 11:44:20 PM
RE: clear events Posted by David Mustakim @ 1/20/2014 11:59:51 PM
RE: clear events Posted by Gene Wirchenko @ 1/21/2014 6:36:20 PM
RE: clear events Posted by David Mustakim @ 1/21/2014 8:52:02 PM
RE: clear events Posted by Stefan Wuebbe @ 1/21/2014 7:10:37 AM
RE: clear events Posted by Gene Wirchenko @ 1/21/2014 6:34:10 PM
RE: clear events Posted by Stefan Wuebbe @ 1/21/2014 9:13:41 PM