Page 1 of 1

Synchronous messaging?

Posted: Tue Jul 31, 2007 1:08 am
by kpeters
Does Rev using blocking (synchronous) messaging?

Just debugged a piece of code that sends a mouseUp to a button before doing a few more things. I had accidentally disabled the button and then the code after the send did not get executed anymore....

TIA,
Kai

Posted: Tue Jul 31, 2007 2:20 am
by Mark
Dear Kai,

You mention two different things here. Synchronous messaging and disabled buttons not executing code. Disabled objects don't execute code when they receive messages. Period.

There are different ways to send a message to another object. If you send a message immediately, it gets executed immediately.

Code: Select all

send "foo" to btn "bar"
If you send a message in 0 millisecs, it is executed right after all currently running handlers have finished, unless one of these handlers contain a "wait with messages" or "repeat with messages" statement.

Code: Select all

send "foo" to btn "bar" in 0 millisecs
In the case of a wait or repeat with messages, the message sent to another object will get executed while other handlers wait.

Best,

Mark

Posted: Tue Jul 31, 2007 4:22 am
by kpeters
I understand what you are saying, Mark - allow me to rephrase my question:

Why would the code "after" the send not execute (I was sending immediately)? Are these immediate messages implemented as blocking calls?

Kai

Posted: Tue Jul 31, 2007 9:25 am
by Mark
Hi Kai,

This morning I have been testing my own theory, and guess what... I am wrong. Even if a button is disabled, its script still runs. Everything else, with regard to messages being sent directly or after a handler has finished, is still correct.

This leads me to the conclusion that there is an error in one of your scripts, assuming that no Revolution bug is involved. Could you post the relevant scripts?

Best,

Mark