Messagemessages

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6614
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Messagemessages

Post by dunbarx » Sat Jan 18, 2020 5:41 pm

This, or whatever its true name is, a close relative of the executionContexts, exists somewhere, though not documented. Richard Gaskin turned me on to it many years ago. There is a thread in the "Experienced..." pane where this may come in handy. Anyone remember what I am talking about?

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7644
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Messagemessages

Post by FourthWorld » Sat Jan 18, 2020 6:19 pm

I can recall many discussions about that property, but not that one specifically.

Do you have a question about messageMessages?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6614
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Messagemessages

Post by dunbarx » Sat Jan 18, 2020 8:43 pm

Ah. Great.

Is there anything published about it? Syntax?

Craig

mrcoollion
Posts: 520
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Messagemessages

Post by mrcoollion » Sun Jan 19, 2020 3:50 pm

Is this what you are looking for ?
https://livecode.fandom.com/wiki/ExecutionContexts

Regards,

Paul

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7644
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Messagemessages

Post by FourthWorld » Sun Jan 19, 2020 3:58 pm

It's not documented by the core team because it was implemented as an ad hoc solution and is subject to change. So use it at your own risk, with the knowledge that any code dependent on it may need to be rewritten in the future.

For a description of what it is and how to use it, see this post to the use-LiveCode list:
http://runtime-revolution.278305.n4.nab ... 93216.html

To see a practical example in action see my tool 4W Flight Recorder, available in Stacks section of LiveNet - in the IDE choose Development -> Plugins -> GoLiveNet.

4W Flight Recorder is like the IDE's Message Watcher, but more flexible and with a more useful layout that indents to show the calling chain, and also provided an approximation of time spent in each handler in the chain. It also includes a set of filters which omit ranges of messages to make the output more useful by eliminating the reams of noise that can flood the list with things like IDE messages, mouseMove messages, and more, all customizable.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6614
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Messagemessages

Post by dunbarx » Sun Jan 19, 2020 8:17 pm

Paul.

I understand the executionContexts. I offered it as a solution in another thread.

viewtopic.php?f=8&t=33551

It is the undocumented "messageMessages" that I am asking about.

Craig
Last edited by dunbarx on Mon Jan 20, 2020 2:32 pm, edited 2 times in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6614
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Messagemessages

Post by dunbarx » Mon Jan 20, 2020 2:33 am

Richard.

I first tried to find this in the forums, but must have misspelled my query, because I got nothing. Trying again:
viewtopic.php?f=6&t=4673&p=20882&hilit= ... ges#p20678

It was you that pointed the way.

I will play with this again when I get back to my office. It may have some use with that thread in the "experienced" pane that the executionContexts seems to have solved.

thanks again.

Craig

mrcoollion
Posts: 520
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Messagemessages

Post by mrcoollion » Mon Jan 20, 2020 7:44 am

dunbarx wrote:
Sun Jan 19, 2020 8:17 pm
Paul.

I understand the exectionContexts. I offered it as a solution in another thread.

viewtopic.php?f=8&t=33551

It is the undocumented "messageMessages" that I am asking about.

Craig
I should have known. :lol:

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6614
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Messagemessages

Post by dunbarx » Mon Jan 20, 2020 2:55 pm

Richard.

This is all academic, but I cannot get anything out of the "messageMessages". I set the "messageMessages" to "true" In a new stack with a couple of cards. I have this in the stack script:

Code: Select all

on openCard
answer random(99)
end openCard

on messageHandled
  breakpoint
end messageHandled 
Navigating produces random numbers, but the breakpoint never fires.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7644
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Messagemessages

Post by FourthWorld » Mon Jan 20, 2020 5:06 pm

I dunno what's up. It works in 4W Flight Recorder.

You might want to try the log command instead of breakpoint, because messageHandled will be sent for EVERY message handled, including those the IDE uses, so if you successfully get into the debugger you may never escape.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2990
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Messagemessages

Post by mwieder » Mon Jan 20, 2020 6:28 pm

Craig-

put the messageHandled handler in a frontscript to see it in action. I don't think it will get to any of the stack scripts.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6614
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Messagemessages

Post by dunbarx » Mon Jan 20, 2020 7:10 pm

Mark.

Yep, that worked. And as Richard warned, that sort of thing can get unruly.

Craig

mrcoollion
Posts: 520
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Messagemessages

Post by mrcoollion » Thu Jan 23, 2020 11:19 am

dunbarx wrote:
Mon Jan 20, 2020 7:10 pm
Mark.

Yep, that worked. And as Richard warned, that sort of thing can get unruly.

Craig
Hi Craig,

I am trying to learn from this thread about 'messageMessages' and 'frontscript'. So could you attach a small sample script for me to analyse?
I cannot seem to get things working in such a way that I understand what is happening.

regards,

Paul

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7644
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Messagemessages

Post by FourthWorld » Thu Jan 23, 2020 4:07 pm

Here's a fully working example, and one of the few practical uses of messageMessages:
viewtopic.php?f=9&t=33553&sid=f10f638f8 ... d3#p187061
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Talking LiveCode”