Yes, you can have a manu staying active while forms run.
You just have another problem with variable scope. If you start a form LINKED to a variable, it only exists as long as the variable exists. That's another reason besides a missing READ EVENTS your form just flashes and then disappears. The menu code ends and the variables you created are released, and so is the form.
Public variables stay in memory until you really RELEASE them, but are not really a solution. How about NOT using a variable at all?
That would work.
Do you need to access the form from outside via the variable? There are many valid reasons to have a reference to a form in a variable, but not just to keep it alive.
The best thing you can do is have a form handler starting forms, keeping track of them. And the simplest form handler is passive, it's just a collection object you add to _SCREEN, eg:
In main.prg do
Code:
_screen.addobject("oForms","Collection")
Then when starting a form do
Code:
DO FORM frmOne NAME loForm
_screen.oForms.Add(loForm)
Now it won't matter, whether loForm is released or not, the form is kept in the oForms collection.
It get's even simpler, if all your forms are based on a base form class, then you can let the form add itself to the collection. In the form INIT event do:
And the best thing is, if you close the form via the close button, or by doing Thisform.Release() in it, it's also automatically removed from the _sceen.oForms collection.
Try it.
Bye, Olaf.