Terry Syverson
2010-12-23 19:30:33 UTC
Hi - I am stumped on an issue with a VFP app I am working on - I am
trying to close the application at midnight (I use sys(2) subtracted
from 86,400 to get the time until midnight and set the timer interval
to that value * 1000).
The problem I am having is that when I issue the "clear all" command,
I get the error "Cannot clear object oTimer because it is still in
use"... Here is the code I'm using:
_screen.AddObject('oTimer','MyTimer')
DEFINE CLASS MyTimer as Timer
* Interval is in milliseconds.
* To get 45 minutes... 60 seconds * 45 * 1000 = 2700000
* To get 5 minutes - 60 * 5 * 1000 = 300000
interval = nMSUntilMidnight
procedure Timer
CLEAR EVENTS
_screen.RemoveObject('oTimer')
CLOSE ALL
CLEAR ALL
RELEASE ALL
QUIT
ENDPROC
For some reason, the RemoveObject doesn't appear to be working,
because I continue to get the error - has anyone ever encountered this
before?
Thanks!
-Terry
trying to close the application at midnight (I use sys(2) subtracted
from 86,400 to get the time until midnight and set the timer interval
to that value * 1000).
The problem I am having is that when I issue the "clear all" command,
I get the error "Cannot clear object oTimer because it is still in
use"... Here is the code I'm using:
_screen.AddObject('oTimer','MyTimer')
DEFINE CLASS MyTimer as Timer
* Interval is in milliseconds.
* To get 45 minutes... 60 seconds * 45 * 1000 = 2700000
* To get 5 minutes - 60 * 5 * 1000 = 300000
interval = nMSUntilMidnight
procedure Timer
CLEAR EVENTS
_screen.RemoveObject('oTimer')
CLOSE ALL
CLEAR ALL
RELEASE ALL
QUIT
ENDPROC
For some reason, the RemoveObject doesn't appear to be working,
because I continue to get the error - has anyone ever encountered this
before?
Thanks!
-Terry