> >procedure TerminateApplication() > =ReleaseAllForms() > clear events > on shutdown > quit >return > >procedure ReleaseAllForms() > local i, obj > > for i = _Screen.FormCount to 1 step -1 > obj = _screen.Forms[i] > if( type('obj') == "O" ) && may have disappeared > if( pemstatus(Obj, 'Release',5) ) > =Obj.Release() > obj = .null. > release obj > endif > endif > endfor > =strtofile("Forms collection "+chr(13)+chr(10) ,"shutdowntrace.txt",.t.) > for m.xx = 1 to _screen.formcount > =strtofile("_screen.forms("+alltrim(str(m.xx))+") = "+_Screen.forms(m.xx).name+chr(13)+chr(10) ,"shutdowntrace.txt",.t.) > next > =strtofile("End of Forms collection "+chr(13)+chr(10)+chr(13)+chr(10) ,"shutdowntrace.txt",.t.) > >endproc >*--------------------------------------------------------------------------->