>CLEAR EVENTS
>FOR x=1 TO _SCREEN.FormCount && This loop could be FOR EACH oFrm in _SCREEN.Forms like David's
> _SCREEN.Forms[m.x].Release
>ENDFOR
>DO CloseData && Closes tables opened at main.prg start
>DO ResetEnvir && Resets SET commands for my development preferences
>RETURN
>Cheers,
Rich,
Both your and Dave's code will fail under certain situations. For example, when three forms are open;
Your code will close form 1, then advance to form 2, hwoever after form 1 closes form 2 is now 1 and 3 is now 2. You close the enw form 2 and then advance to form 3, the problem now there is no form 3 to close and you get an error or at least leave form 3 open. Instead the call to the release in your code should always do _screen.forms(1).Release(), as the forms will advance in the forms collection as they are closed.