Synchronous messaging?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm

Synchronous messaging?

Post by kpeters » Tue Jul 31, 2007 1:08 am

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Jul 31, 2007 2:20 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm

Post by kpeters » Tue Jul 31, 2007 4:22 am

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Jul 31, 2007 9:25 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply