Suppressing Unnecessary Messages

Fatih Batal endernafi at gmail.com
Thu Oct 10 11:02:58 CEST 2013


Hi all,

Does LiveCode engine send all possible messages constantly,
regardless of that particular handler is implemented in the script or not?

If I place a *mouseEnter* handler into the card script, that handler gets
the message and does its thing.
But if don't place any *mouseEnter* handler in any object, does the message
still fire up?

If yes,
isn't this a waste of valuable resources?
Again, if yes, could suppressing these unnecessary / not-handled messages
give an edge regarding performance?


A better solution to this is, of course, handling that in engine.
Engine crawls the scripts when the Run/Browser button is clicked or the
standalone is saved.
Then, it only fires up the messages which are handled in the script by the
programmer.

A worse solution is, making a script which puts empty handlers for
unnecessary messages into every each one of bottom-object of the project.
Bottom-object is the first-responders, of course.

The script crawls the project;
if it finds a handled message, removes that from its list {a list of all
bundled messages of LiveCode}.
Then it puts this list {on mouseEnter & cr & end mouseEnter & cr & on
mouseLeave & cr & end mouseLeave, .... } into each scriptable object which
is a first-responder.

Does this make sense to you?

This idea may be superfluous, still I wanted to get your insights about it
before I roll up my sleeves.


Best,

~ Ender Nafi
~... together, we're smarter ...~


More information about the use-livecode mailing list