> >
> > When there is a "Read Events" being active, issuing "Clear Events" should be enough.
> > In addition, the QueryUnload() event of each active form will run, so that you can ask the user whether modified data shall be committed or reverted, and so on.
> >
> > Additionally, you can scan the _scren.Forms collection to see whether there any modal forms running, e.g. in pseudo code:
> >
> > Local loForm
> > For Each loForm in _screen.Forms
> > If VarType(m.loForm) = 'O' And PemStatus(m.loForm,"YourShutdown",5)
> > loForm.yourShutdown()
> > Endif
> > Next
> >
> >
> > In other words, from a client-app point-of-view, the situation would be similar to a user clicking the upper-right X close button of the VFP main window _screen. (Or the close button of the main top-level form, when you have _screen.Visile=.F., respectively.)
> >
> > hth
> > -Stefan
>
> Pls tell me what is funtion yourShutdown() in detail
It would contain everything you need to do in your particular form/class when the form is getting closed "unexpectedly" - or "from outside", so to say.
So it depends on your requirements, e.g. you might want to check whether any alias contains "dirty" data via GetNextModified() and GetFldState() and so on.
hth
-Stefan