o=Createobject('MyClass') Define Class MyClass As Custom Function Init LOCAL mKey Do While .t. ? Datetime() mKey=Inkey(1) IF INLIST(mKey, 27, 97, 104) && Esc, Ctrl+F4, Alt+F4 EXIT ENDIF EndDo EndDefine >Can anybody tell me what's wrong with this code? Or, can anybody suggest a workaround? > ><pre> >x=.T. >On Shutdown x=.F. > >o=Createobject('MyClass') > >Define Class MyClass As Custom > Function Init > Do While x > ? Datetime() > =Inkey(1) > EndDo >EndDefine >>