Hi Mike,
Just cycling back to this problem - should I be issuing the CLEAR EVENTS *before* the THISFORM.Release() or after?
Albert
>>Hi all,
>>
>>I have an app that runs on a server and I need it to autoshutdown each night. It *mostly* works but sometimes chokes on trying to shut down so I wonder if I have the code in the right order or right place:
>>
>>The app has one form and on that form I have a timer that fires every 15 seconds.
>>
>>In the timer's .timer() method, this code checks the time and tries to shut down after 11 pm:
>>
>>
>>
>>IF VAL(LEFT(TIME(),2)) >= 23
>>
>> * release this form and then try to clear the read
>> ON ERROR
>> THISFORM .Release()
>>
>> ON SHUTDOWN
>> CLEAR EVENTS
>>
>>ENDIF
>>
>>
>>
>>Questions:
>>
>>1) is the order correct on the above commands?
>>2) should this code be in some method of the form itself?
>>3) it does not seem like I need a QUIT most of the time - would this be better?
>>
>>Thanks,
>>
>>Albert Gostick
>
>By the way, if the app started at 11 am, the timer would not need to fire every 15 seconds. It would only need a 12 hour interval and fire once.