alarm_set


描述

This function can be used to set an alarm. 你需要提供计时器的编号,从0到11,然后为计时器设置一个值。The value must be an integer value, and you can set it to -1 to stop the alarm. This is an alternative method to setting the alarm array directly.


语法:

alarm_set(index, value);

参数 描述
index The alarm index to set, from 0 to 11.
The value (an integer) to set the alarm to.


返回:

N/A(无返回值)


例如:

for (var i = 0; i < 12; i++)
   {
   if alarm_get(i) > 0 alarm_set(i, -1);
   }

The above code checks all the alarms in the calling instance and if they are greater than 0 it sets them to -1, stopping them from counting down any further.