[SOLVED] Message box

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

Post Reply
anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

[SOLVED] Message box

Post by anmldr » Fri May 15, 2020 4:16 am

Trying to learn more about the message box tonight. Is it primarily for testing purposes? Or, if I enter something like

Code: Select all

set the fullscreen mode of this stack to "exactFit"
,
is the property now changed if I save the stack. Or, like I wrote first, is this just for testing and I need to manually enter that property elsewhere?

Linda
Last edited by anmldr on Fri May 15, 2020 2:19 pm, edited 1 time in total.

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

Re: Message box

Post by Klaus » Fri May 15, 2020 8:05 am

Hi Linda,

the Message Box is the "command line" of LC and everything you enter (and excute) there are valid (and sticking) LC commands!

It is mainly a helper for LC! Instead of creating a button to do something and delete it later, just use the Message Box.
Get used to it, you will love it in the end! :-)


Best

Klaus

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

Re: Message box

Post by richmond62 » Fri May 15, 2020 8:17 am

I find the Message Box very useful because, if I have some longish code running inside a button where I cannot "see" what is
happening I can do this sort of thing to test it:

PseudoCode:

on mouseUp
do the first thing
put "step 1"
wait 5 secs
do the second thing
put "step 2"
wait 5 secs
do the third thing
put "step 3"
wait 5 secs
end mouseUp


So, as each task is achieved a signal (step1, step 2, step 3) appears in the Message Box, and if a signal does NOT
appear I know that something has gone wrong.

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: [SOLVED] Message box

Post by SparkOut » Fri May 15, 2020 6:07 pm

I took a while to grok the message box when I first started with LiveCode (or Runtime Revolution as it was then). But yes, it will become valuable to you as you get more used to it.
It is a place for ephemeral output, such as debugging by including a line to "put tValue" at points so you can get an idea that your application is working with expected data ranges without cluttering up with "answer" dialogues (as per Richmond's use case). (In most cases (ie anywherebut LC Server, I believe), "putting" a value into the message box will only be visible in the IDE, so debug code doesn't need to be ripped out from a standalone.)
It is also, as Klaus says, the command line for the IDE, everything you can do with the Property Inspector and Tools Palette to set or create objects and values can be done in the message box. If you use the Property Inspector to tick a checkbox for "focus with keyboard", for instance, you could do the same by typing "set the traversalOn of the selectedObject to true" in the message box.
Last edited by SparkOut on Fri May 15, 2020 6:12 pm, edited 1 time in total.

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

Re: [SOLVED] Message box

Post by jacque » Fri May 15, 2020 6:09 pm

anmldr wrote:
Fri May 15, 2020 4:16 am
Trying to learn more about the message box tonight. Is it primarily for testing purposes? Or, if I enter something like

Code: Select all

set the fullscreen mode of this stack to "exactFit"
,
is the property now changed if I save the stack. Or, like I wrote first, is this just for testing and I need to manually enter that property elsewhere?
If the property is normally saved to the stack then yes, it will be permanent. But fullscreenmode isn't a permanent property so you'd still need to add that to your script.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: [SOLVED] Message box

Post by anmldr » Sat May 16, 2020 4:49 am

Thanks, Jacque. How do I differentiate between permanent properties and impermanent ones?

Something like the background color of an object would be permanent and every other thing that is referred to in the property inspector? While something like "fullscreen mode" is not since it is not one of the properties that you can find in the property inspector?

Linda

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

Re: [SOLVED] Message box

Post by jacque » Sat May 16, 2020 6:29 pm

Good question. The property inspector is a good place to start since those are all permanent. In some cases the dictionary will point out that a particular property needs to be scripted, sometimes only by inference. Fullscreenmode, for example, suggests where in the script to place the instruction. The defaultcursor property explains that it resets automatically but doesn't specifically say you need to script it. Occasionally an entry will specify that the property isn't saved with the stack.

Looking at this with beginner eyes, I think the dictionary needs to be clearer about it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”