world.DeleteTimer
Deletes a timer
Prototype
long DeleteTimer(BSTR TimerName);
Description
Deletes the named timer from the list of timers.
WARNING - if the timer is executing a script it cannot be deleted. For example, a timer cannot delete itself.
If you need to delete a timer from within itself use DoAfterSpecial to delete it after a short delay. You might also want to use EnableTimer to disable it first.
VBscript example
world.DeleteTimer "mytimer"
Jscript example
world.DeleteTimer("mytimer");
PerlScript example
$world->DeleteTimer("mytimer");
Python example
world.DeleteTimer("mytimer")
Lua example
DeleteTimer("mytimer")
Return value
eInvalidObjectLabel: The timer name is not valid
eTimerNotFound: The named timer does not exist
eItemInUse: Cannot delete trigger/alias/timer because it is executing a script
eOK: deleted OK
Related topic
See also
| Function | Description |
|---|---|
| AddTimer | Adds a timer |
| DeleteTimerGroup | Deletes a group of timers |
| DoAfterSpecial | Adds a one-shot, temporary, timer to carry out some special action |
| EnableTimer | Enables or disables an timer |
| GetTimer | Gets details about a timer |
| GetTimerInfo | Gets details about a timer |
| GetTimerList | Gets the list of timers |
| IsTimer | Tests to see if a timer exists |
| ResetTimer | Resets a named timer |
| ResetTimers | Resets all timers |