Clear the MessageBox

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Clear the MessageBox

Post by Klaus » Sun Apr 10, 2022 5:32 pm

I rather think the limitation is in some of the scripts/behavior of the message box stack.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Clear the MessageBox

Post by richmond62 » Sun Apr 10, 2022 5:41 pm

Possibly.

I have, however, reached my LIMIT for now. 8)

I have got to have a bath, select a tie, trim my beard, and so forth,
and get ready to give a moderately good impression tomorrow
with all the Ukrainian kids and their Mums and Dads at my school.

I have got 11 kids coming free of charge until the end of June:
not really worried about teaching English as a Farcical Language as such,
much, much more worried about the emotional tone of things.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3999
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Clear the MessageBox

Post by bn » Sun Apr 10, 2022 6:49 pm

Richmond,

you could also put into the single line message box

Code: Select all

put revIDEGetPreference("IDESingleLineMessageHistory")
Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Clear the MessageBox

Post by richmond62 » Sun Apr 10, 2022 7:24 pm

I did:
-
SShot 2022-04-10 at 21.23.39.png
-
But I still have to have a bath. 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Clear the MessageBox

Post by richmond62 » Mon Apr 11, 2022 7:24 am

So you really watched the field for 3 minutes straight?
OhhhhhhKayyyyyyyy...
I played football with a large wooden marble and the cat.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Clear the MessageBox

Post by richmond62 » Mon Apr 11, 2022 7:27 am

And I did that again, at my work with LC 8.1.10 on my iMac running MacOS 10.7.5:
-
Screen Shot 2022-04-11 at 9.25.40 AM.png
-
And what am I supposed to do with that information, forbye?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3999
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Clear the MessageBox

Post by bn » Mon Apr 11, 2022 7:33 am

richmond62 wrote:
Mon Apr 11, 2022 7:27 am
And I did that again, at my work with LC 8.1.10 on my iMac running MacOS 10.7.5:

And what am I supposed to do with that information, forbye?
I thought you wanted to know how many lines were buffered by the message box.

If that is wrong then I misunderstood something.

Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Clear the MessageBox

Post by richmond62 » Mon Apr 11, 2022 7:38 am

What I would like to know is 2 things:

1. The maximum number of lines that can be buffered by the message box.

[I have already demonstrated that it is > 10,000]

2. A way to set a maximum number of lines that can be buffered by the message box.

As the lines are stored in a field called "messages" in the revpreferences stack I wonder
if there is a way to restrict the number of lines in a listField?

In a perfect world the Preferences stack of the IDE would contain a far larger number
of settings that could be tweaked to what would serve the end-user.

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

Re: Clear the MessageBox

Post by marksmithhfx » Fri Apr 15, 2022 2:12 pm

bn wrote:
Sun Apr 10, 2022 6:49 pm
Richmond,

you could also put into the single line message box

Code: Select all

put revIDEGetPreference("IDESingleLineMessageHistory")
Kind regards
Bernd
Suddenly I want to add a little button to the right of the message box header bar that does just this. How brilliant!!!!!
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

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

Re: Clear the MessageBox

Post by marksmithhfx » Fri Apr 15, 2022 2:24 pm

richmond62 wrote:
Mon Apr 11, 2022 7:27 am
And I did that again, at my work with LC 8.1.10 on my iMac running MacOS 10.7.5:
-
Screen Shot 2022-04-11 at 9.25.40 AM.png
-
And what am I supposed to do with that information, forbye?
Well, it would save you loads of time having to scroll back through a list looking for something. And from the fact that I have at most 200 commands, it is evident that somewhere in the past I figured out (or accidentally) deleted all of the msgs in my msg box.

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Clear the MessageBox

Post by jacque » Fri Apr 15, 2022 5:44 pm

richmond62 wrote:
Mon Apr 11, 2022 7:38 am
What I would like to know is 2 things:

1. The maximum number of lines that can be buffered by the message box.

[I have already demonstrated that it is > 10,000]
Not exactly. You demonstrated that you could put the contents of one field into another directly. The message box scripts may manipulate storage dynamically (but I haven't checked.)

Aside: the reason your test took 3 minutes is because you wrote to a field on every pass through the loop. If you'd written to a variable instead it would have taken only a few seconds, if that.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 135
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: Clear the MessageBox

Post by bobcole » Sat Apr 16, 2022 8:00 pm

I put Bernd's code into a button:

Code: Select all

on mouseUp pButtonNumber
   put revIDEGetPreference("IDESingleLineMessageHistory") into field "MessageBox History"
   put the number of lines of field "MessageBox History" into field "Lines"
end mouseUp
The script stuffs the number of lines into another field.
The results show 200 lines.
Execute a few more commands in the message box and run the button again...still 200 lines.
Unless I am missing something, it seems to me that the answer to richmon62's question is ... 200 lines (at least on my system).
Bob C
I'm using LC 10.0.0-dp-3 on macOS 12.3.1 (Monterey)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Clear the MessageBox

Post by richmond62 » Sat Apr 16, 2022 8:03 pm

Clever stuff, and 200 is useful to know. Thanks. :)

It is also worth knowing that ONLY valid code snippets that have been run are kept:

When I wrote 'shave me knees' in the messageBox it did NOT increment the number
of remembered lines. 8)

When I wrote 'put "hello"' the number of remembered lines was only incremented AFTER I had
hit the ENTER key.

PaulDaMacMan
Posts: 627
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Clear the MessageBox

Post by PaulDaMacMan » Tue Apr 26, 2022 9:31 pm

That 200 limit is "hardcoded" as a constant in the IDE file revmessageboxbehavior.livecodescript.
I think it could / should be made setable.
Seems like a rather arbitrary number to me.

Code: Select all

script "revMessageBoxBehavior"
##GH created 12/11/2014
##GH last updated 31/12/2014

local lSelectedCard, lCardHistoryPref
constant kHistoryMax = 200
constant kHalfMessageFieldHeight = 12.5
constant kExternalErrorCode = 0
I do like the idea of a button. or maybe a special key-combo, that would dump your msg box history into the msg box result field all at once. I can't imagine the total minutes that I've spent scrolling back through the list one keypress at a time looking for something I put in there a month ago, seems like that would be a great time saver.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”