Hello FoxEgg,
thanks for the Star.
A little more to clarify the usage and the effect of READ EVENTS:
when READ EVENTS is executed this halts execution of further code until CLEAR EVENTS triggers to get back to READ EVENTS. What doesn't halt is the processing of windows events, such as button clicks etc.
So if you put READ EVENTS in the init of your form, that will stop execution of the Init method and so the form will not show up.
You should have a main.prg where you start your form, probably with DO FORM ... Put READ EVENTS after this call of the form, not within the form.
You can put CLEAR EVENTS in the Unload of the form and then foxpro will continue with what comes after READ EVENTS, when the user exits the form. That could be CLOSE DATABASES ALL and some more...everybody you ask does something different there.
If you have a complexer application with more forms and
a menu and/or toolbar the CLEAR EVENTS is best put in the File->Quit or in an Exit-Button on the toolbar.
Where to put the READ EVENTS depends on when you think your applilcation is "ready to go", which is not in a forms init and not in the forms activate event either
(because that is triggered everytime the form is activated).
By the way you can also live without READ EVENTS in a single form application if you set that form to be modal
(Windowtype = 1). Then foxpro will continue after DO FORM only when the form is closed.
Bye, Olaf.