Code: Select all
--------
-------- Timer
--------
local aTimer = nil
local aTimerInterval = 100
local function aTimer_tick(timer)
timer.destroy()
-- body
end
aTimer = createTimer(MainForm)
aTimer.Interval = aTimerInterval
aTimer.OnTimer = aTimer_tick
Code: Select all
--------
-------- Timer
--------
local aTimer = nil
local aTimerInterval = 100
local aTimerTickMax = 5000
local aTimerTicks = 0
local function aTimer_tick(timer)
if aTimerTickMax > 0 and aTimerTicks >= aTimerTickMax then
timer.destroy()
end
aTimerTicks = aTimerTicks + 1
-- body
end
aTimer = createTimer(MainForm, false)
aTimer.Interval = aTimerInterval
aTimer.OnTimer = aTimer_tick
aTimer.Enabled = true
Code: Select all
{$lua}
------------------------------ ENABLE ------------------------------
[ENABLE]
local aTimer = nil
local aTimerInterval = 100
local function aTimer_tick(timer)
-- body
end
----------------------------------
if syntaxcheck then return end
aTimer = createTimer(MainForm)
aTimer.Interval = aTimerInterval
aTimer.OnTimer = aTimer_tick
------------------------------ DISABLE ------------------------------
[DISABLE]
if syntaxcheck then return end
aTimer.destroy()