I am working an an animation and sometimes I get some random results that appear to be related to when I move the mouse or maybe a "Send to me" instruction and I need to know how these handlers work.
I know the priority of the messages (more or less - object to card to stack).
My program uses " send to me" and card "Mouse down", "mouseV" and "mouseH" (to simulate a swipe left,right,up or down).
My question is how does LiveCode 7 and 8 respond when it is inside a stack routine the following events occur:
1. When it comes time for the "Send to me" message to return.
a. Does it wait for the program to finish the current routine. before going to the routine with the "send to me" instruction.
b. Does it immediately exit the routine and go to the routine that has the "send to me" and after completing the "send to me" routine does not come back to point it was in the previous routine
c. Does it immediately exit the routine and go to the routine that has the "send to me" and after completing the "send to me" routine returns to the same point it was just before it exit the routine.
2. When the "card" Mouse is clicked or moved and it leaves the current routine that is running, what happens?
a. Does it wait for the program to finish the current routine
b. Does it immediately exit the current routine and go to the "card MouseDown" routine and after completing the card routine not come back to the previous routine
c. Does it immediately exit the current routine and go to the "card MouseDown" routine and after completing the card routine back to the previous routine to the same point it was just before it exit the routine.
Thanks,
David
Program Instruction executions? - Solved
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Program Instruction executions? - Solved
Last edited by DR White on Sun Nov 29, 2015 4:48 pm, edited 1 time in total.
Re: Program Instruction executions?
It depends on how the "send" command is structured. If there is a time parameter ("send x to me in 1 second") then the current handler completes and the sent command executes after the allotted time. If you send in 0 seconds, the command will execute immediately after the originating handler finishes.DR White wrote:1. When it comes time for the "Send to me" message to return.
a. Does it wait for the program to finish the current routine. before going to the routine with the "send to me" instruction.
b. Does it immediately exit the routine and go to the routine that has the "send to me" and after completing the "send to me" routine does not come back to point it was in the previous routine
c. Does it immediately exit the routine and go to the routine that has the "send to me" and after completing the "send to me" routine returns to the same point it was just before it exit the routine.
However, there is no reason to use "send" if the second handler is already in the same script, just call the handler directly. In that case it acts the same as "send" without a time parameter; the called handler executes in-line then the rest of the original handler completes. In other words, these are identical:
Code: Select all
on doSomething
send "handler2" to me
end doSomething
on doSomething
handler2
end doSomething
The first option "a". The current handler always completes, other actions are placed in a queue and messages are sent from the queue in the order they occurred.2. When the "card" Mouse is clicked or moved and it leaves the current routine that is running, what happens?
a. Does it wait for the program to finish the current routine
b. Does it immediately exit the current routine and go to the "card MouseDown" routine and after completing the card routine not come back to the previous routine
c. Does it immediately exit the current routine and go to the "card MouseDown" routine and after completing the card routine back to the previous routine to the same point it was just before it exit the routine.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Program Instruction executions?
Jacque,
Thanks
Thanks