Help. I feel stuck and stupid.
I need a timer to read value (constantly).
al = getAddressList()
mr = al.getMemoryRecordByDescription("Description here")
CEEditBox.Text = mr.Value
How to create a timer ?
Re: How to create a timer ?
Code: Select all
--------
-------- Timer
--------
local aTimer = nil
local aTimerInterval = 10
local aTimerTicks = 0
local aTimerTickMax = 0
local function aTimer_tick(timer)
if aTimerTickMax > 0 and aTimerTicks >= aTimerTickMax then
timer.destroy()
end
aTimerTicks = aTimerTicks + 1
-- body
end
aTimer = createTimer(getMainForm(), false)
aTimer.Interval = aTimerInterval
aTimer.OnTimer = aTimer_tick
aTimer.Enabled = true
Re: How to create a timer ?
A simpler option might be to let CE handle it whenever it updates the memory record using OnGetDisplayValue
Code: Select all
al = getAddressList()
mr = al.getMemoryRecordByDescription("Description here")
mr.OnGetDisplayValue = function(mr,valuestring)
--CETrainer.CEEdit1.Text = valuestring -- testing
CEEditBox.Text = valuestring
end
Re: How to create a timer ?
Thanks.FreeER wrote: ↑Sun Jan 07, 2018 3:20 pmA simpler option might be to let CE handle it whenever it updates the memory record using OnGetDisplayValueCode: Select all
al = getAddressList() mr = al.getMemoryRecordByDescription("Description here") mr.OnGetDisplayValue = function(mr,valuestring) --CETrainer.CEEdit1.Text = valuestring -- testing CEEditBox.Text = valuestring end
I'll do some tests and report.
Edit:
Error
Code: Select all
al = getAddressList()
mr = al.getMemoryRecordByDescription("Description here")
mr.OnGetDisplayValue = function(mr,valuestring)
--CETrainer.CEEdit1.Text = valuestring -- testing
CEEditBox.Text = valuestring
end
Code: Select all
al = getAddressList()
mr = al.getMemoryRecordByDescription("Description here")
mr.OnGetDisplayValue = function(mr,valuestring)
CETrainer.CEEdit1.Text = valuestring -- testing
--CEEditBox.Text = valuestring
end
Who is online
Users browsing this forum: No registered users