BBjAPI::createTimer
Description
In BBj 3.00 and higher, this method creates a timer, which calls a method on a UserObject at a specified interval.
Syntax
Return Value |
Method |
---|---|
void |
createTimer(Object key, number seconds, string label) |
void |
createTimer(Object key, number seconds, UserObject obj, string methodName) |
Parameters
Variable |
Description |
---|---|
key |
A unique key that identifies the timer. If numeric, the key will be returned in field y of the event string (see Timer Event). |
label |
The subroutine to be invoked when the timer fires. |
seconds |
Specifies the timeout value in seconds. Fractional seconds are allowed to millisecond resolution, but a very small timeout value will cause a flood of events faster than the program can respond to them. |
obj |
A UserObject containing the method to be called when the timer fires. |
methodName |
The name of the method that is to be called when the timer fires. |
Return Value
None.
Remarks
When registering a UserObject method as the target of the callback, the method must conform to the following constraints:
-
The method must be declared as public with a return type of void.
-
The method must accept a single parameter.
The type of the method parameter must be either BBjTimerEvent or BBjEvent or java.lang.Object.
To eliminate the timer, see removeTimer.
Example
|
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.