nTime | (Long) Either time period (period or timeout) in milliseconds, after which the function is called
or date and time (Date data type) when the function is called. |
---|---|
nType | (Long) Inner timer request type.
0 - (or -1 obsolete) The function will be called repeatedly with defined period (the nTime parameter).
1 - The function will be called once with defined delay (the nTime parameter).
2 - The function will be called once with the specified date and time. This method is not functional in Web panels. |
sFuncId | (String) Identifier of registered event function.
- Allows removal of the function by the RemoveEventTimer method.
- Prevents duplicate registering of the same function.
- May contain any characters (this is not a system name).
- Must not be an empty string.
- It is recommended to use e.g. the whole path to the Pma object. |
Func | (Function) JavaScript event function that will be called by application timer. |
function onTick()
{
Pm.Debug("onTick: tClick=" + Pm.FormatDate(tClicked, 1) + ", nCounter=" + nCounter);
if (nCounter-- > 0)
{
pMe.Root.AddEventTimer(1000, 1, pMe.GetPathName(), onTick);
}
}
var tClicked = Pm.Time;
var nCounter = 10;
pMe.Root.AddEventTimer(1000, 1, pMe.GetPathName(), onTick);
function onTick()
{
Pm.Debug("onTick: tClick=" + Pm.FormatDate(tClicked, 1) + ", nCounter=" + nCounter);
if (nCounter-- < 0)
{
pMe.Root.RemoveEventTimer(pMe.GetPathName());
}
}
var tClicked = Pm.Time;
var nCounter = 10;
pMe.Root.AddEventTimer(60, 0, pMe.GetPathName(), onTick);