TIMER

A TIMER is an invisible control that simply counts off the passage of time. You can set how long that time is. When the time passes, the control causes a TIMER event to happen with your window containing the timer control. By default, a TIMER control automatically destroys itself after the time-out period, but your window's TIMER event handler can RETURN nothing to allow the TIMER to count off the same time period again.


Uses

Can be used to count the passage of time, or to automatically dismiss a window without user interaction.


Styles

A TIMER has no styles.


Events

A TIMER generates a TIMER event on the window containing the TIMER.


REXX Variable

A TIMER has no REXX variable associated with it.


Dynamically add/remove a TIMER

You can dynamically add a TIMER to an already open window by calling GuiAddCtl. You must pass a line that describes the control. The format for this line is:

TIMER Amount

Amount is the desired time-out period, in milliseconds.

For example, here we add a TIMER with a timeout period of 1 second (ie, 1000 milliseconds):

error = GuiAddCtl("TIMER 1000")
Note: You are limited to only one TIMER in a given window.

You can dynamically remove a TIMER by calling GuiRemoveCtl. Omit the first arg. Here we remove the above control:

error = GuiRemoveCtl()