Messagemessages

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
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: 9842
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
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: 720
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: 9842
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
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: 9670
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: 720
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: 9670
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: 9842
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
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: 9670
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: 720
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: 9842
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: Messagemessages

Post by marksmithhfx » Thu Sep 17, 2020 1:27 pm

FourthWorld wrote:
Sun Jan 19, 2020 3:58 pm
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.
Is there anything avail that could be called from inside an app (I'd like to run something inside an iOS app for example) that could be turned on/off under script control. Something along the lines of:

Code: Select all

on messagesStartRecording
   open file (specialFolderPath("documents") & “/messages.txt")
end messagesStartRecording

Code: Select all

on messagesStopRecording
   close file (specialFolderPath("documents") & “/messages.txt")
end messagesStopRecording
In particular I am looking to find out what kind of messages are sent to a datagrid when you swipe across a control and "swipes" are enabled. I am just starting down this path and the documentation I've found is not overly helpful, but also in general having the ability to capture which messages are sent in specific situations would be useful.

Maybe there is something like this already and I don't know about it?

Thanks
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Post Reply

Return to “Talking LiveCode”