Mike,
Yes, I've got exactly that in the main program. I've also got, a couple of lines earlier, ON SHUTDOWN DO CLEANUP, and the Cleanup program does
CLEAR EVENTS
RELEASE ALL EXTENDED
QUIT
There's also a CLEAR EVENTS in the Destroy and Deactivate methods of the top-level form, just to make sure.
The other thing the main program does, apart from setting icons and so on is to issue
_Screen.Visible=.F.
Maybe that's a problem, and I ought to be doing something like
Application.Visible=.F.
in the top-level form's Init method to hide the main FoxPro window. I haven't tried that yet.
I must admit that I hadn't realised that the program would return to READ EVENTS the first time *any* window closes: that would explain a lot. The documentation suggests that the program doesn't return here until CLEAR EVENTS is encountered, and there are no CLEAR EVENTS statements anywhere in my subsidiary forms, so closing them shouldn't have that effect. What I really want the program to do is to return to the point in the top-level form from which it was called.
(I had no success last night with form sets either.)
Incidentally, I notice that you are putting () after the .Release method. It seems to work just the same as .Release. Is there something I ought to know about the ()?
Tony Ayres