stopping all running scripts |SOLVED|
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
stopping all running scripts |SOLVED|
Hi all,
I have been a Flash and Director developer for years, and just this week bettered my life and switched to LiveCode. The speed at which I can get things done baffles me by the way!
But as is to be expected, there are some hickups too. In Flash you can test a script by pressing ctrl-enter for instance, you get your program in a window and if you close that window you effectively halt all scripts. In Director, which behaves more like livecode, you have a play and stop button. Pressing the stop button halts all scripts too. But in LiveCode I run into a problem. When I test it, some scripts which execute at standard intervals keep running, consequently LiveCode gets reaaaaaaaal slow and I have to go to the script and put in a breakpoint in order to be able to stop executing it. So far that works, but as my project will grow that won't be practical anymore. Is there a way to just stop all the scripts from executing? A command that I can enter in the message box or something?
Thanks in advance,
Johan
I have been a Flash and Director developer for years, and just this week bettered my life and switched to LiveCode. The speed at which I can get things done baffles me by the way!
But as is to be expected, there are some hickups too. In Flash you can test a script by pressing ctrl-enter for instance, you get your program in a window and if you close that window you effectively halt all scripts. In Director, which behaves more like livecode, you have a play and stop button. Pressing the stop button halts all scripts too. But in LiveCode I run into a problem. When I test it, some scripts which execute at standard intervals keep running, consequently LiveCode gets reaaaaaaaal slow and I have to go to the script and put in a breakpoint in order to be able to stop executing it. So far that works, but as my project will grow that won't be practical anymore. Is there a way to just stop all the scripts from executing? A command that I can enter in the message box or something?
Thanks in advance,
Johan
Last edited by Johan_VH on Fri Jul 04, 2014 4:34 pm, edited 1 time in total.
Re: stopping all running scripts
"standard intervals"... you mean you send messages "in time" ?
To delete all pending messages, in this case :
To delete all pending messages, in this case :
Code: Select all
put the pendingmessages into myMsgs
repeat for each line myMsg in myMsgs
cancel item 1 of myMsg
end repeat
Re: stopping all running scripts
Since I'm new to LiveCode, I'm probably not coding in the best way possible, I'm not using timers (yet)....
I have a handler, it executes and then have it check if it should execute again. If so, it goes to another handler that calls the first handler again.
I noticed that just calling the handler again from within the handler caused LiveCode to execute again and again, thus crashing LiveCode. I tried to solve this with the 'exit' command, but it didn't do the trick.
gScreenSaverActive is set to 0 when an RFID is scanned and is received by an xml socket. I now have to go through the motions to stop it, a shortcut that just halts all scripts would be easier...
I have a handler, it executes and then have it check if it should execute again. If so, it goes to another handler that calls the first handler again.
I noticed that just calling the handler again from within the handler caused LiveCode to execute again and again, thus crashing LiveCode. I tried to solve this with the 'exit' command, but it didn't do the trick.
Code: Select all
on animateScreensaver
switch (pSwitch)
case 1
move image "logo.png" from 600,394 to 200,394 in 1 seconds
move field "Titel_txt" from 85,389 to 705,389 in 1 seconds
wait 1 second
move image "logo.png" from 200,394 to 600,394 in 1 seconds
move field "Titel_txt" from 705,389 to 85,389 in 1 seconds
put 2 into pSwitch
if gScreenSaverActive=1 then
continueAnimation
else
go stack "game"
end if
break
case 2
move image "scan_logo.png" from 600,392 to 320,392 in 1 seconds
move field "Titel_txt" from 85,389 to 705,389 in 1 seconds
wait 1 second
move image "scan_logo.png" from 320,392 to 600,392 in 1 seconds
move field "Titel_txt" from 705,389 to 85,389 in 1 seconds
put 1 into pSwitch
if gScreenSaverActive=1 then
continueAnimation
else
go stack "game"
end if
break
case 3
break
end switch
end animateScreensaver
Code: Select all
on continueAnimation
wait 1 second
animateScreensaver
end continueAnimation
Re: stopping all running scripts
Hi Johan,
check "movingcontrols" in the dictionary, this will give you a list of all controls that are currently (still) moving.
Then you can stop their movement similar to cancelling the pendingmessages:
Best
Klaus
check "movingcontrols" in the dictionary, this will give you a list of all controls that are currently (still) moving.
Then you can stop their movement similar to cancelling the pendingmessages:
Code: Select all
...
put the movingcontrols into tMCs
repeat for each line tMC in tMCs
stop moving tMC
end repeat
...
Klaus
Re: stopping all running scripts
After 8 years I've never heard of it, must be a lot more I don't know...Klaus wrote: check "movingcontrols" in the dictionary, this will give you a list of all controls that are currently (still) moving.
Thanks for that Klaus.
Paul
-
- Posts: 87
- Joined: Wed Mar 25, 2015 2:01 am
Re: stopping all running scripts |SOLVED|
Keep Message Box (Pending Messages) open. Click on "Cancel All"