Goal: To run an "update" handler every 15 min once they enter and have a certain card active.
Issue: What I noticed is it doesn't wait the "10" seconds. The answer box comes back within milliseconds of pressing the OK. Then it freezes livecode.
Code: Select all
On PreOpenCard
UpdateCheck
end PreOpenCard
on UpdateCheck
repeat
put the short name of this card into theCard
if theCard = "TargetCard" then
updateCARD --handler that does items that is located on stack script as I call it in other handlers as well
send "UpdateCheck" to me in 10 seconds --this would normally be 600 seconds
answer "Here"
end if
end repeat
end UpdateCheck
Third question: Do you recommend me clearing any pending messages as well within this script to prevent memory leaks:
Code: Select all
on MyTimer
DoSomethingPeriodically
if MyTimer is not in the pendingMessages then
send "MyTimer" to me in 1 second
end if
end MyTimer
I used this post to help me get started, fyi.
http://forums.livecode.com/viewtopic.php?f=7&t=24243
Thank you for any help in these matters.