Freezing Repeating Loop Not Tied to Button
Posted: Thu Dec 03, 2015 4:50 am
Hello I wanted to ask if someone could look at this code. I keep getting a frozen stack and unaware of the short keys to kill the stack in this situation -->My second question
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.
Any help would be appreciated as this kind of code logic would be useful to me on many levels. Thanks
Third question: Do you recommend me clearing any pending messages as well within this script to prevent memory leaks:
http://forums.livecode.com/viewtopic.php?f=9&t=15480
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.
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.