script on timer?
Posted: Wed Feb 12, 2014 12:30 am
is there a way to run a set of code every minute without any user interaction when on a specific card?
like onMouseup but on5minuteinterval
like onMouseup but on5minuteinterval
Questions and answers about the LiveCode platform.
https://forums.livecode.com/
Code: Select all
local sKeepRepeating
on openCard
--set up the script variable to control whether the handler can be stopped later on
put true into sKeepRepeating
--make the first call to repeatingHandler
repeatingHandler
close openCard
on repeatingHandler
--if the script variable is true then proceed
--otherwise if it is false this handler runs through and is not called again
if sKeepRepeating then
--do some stuff
--if you wish to stop this handler being repeatedly called
--you can set sKeepRepeating to false here
--this is the 'recursion' bit - where the handler calls itself
send repeatingHandler to me in 5 seconds
end if
close repeatingHandler