Page 1 of 1

[SOLVED] Message box

Posted: Fri May 15, 2020 4:16 am
by anmldr
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

Re: Message box

Posted: Fri May 15, 2020 8:05 am
by Klaus
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

Re: Message box

Posted: Fri May 15, 2020 8:17 am
by richmond62
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.

Re: [SOLVED] Message box

Posted: Fri May 15, 2020 6:07 pm
by SparkOut
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.

Re: [SOLVED] Message box

Posted: Fri May 15, 2020 6:09 pm
by jacque
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.

Re: [SOLVED] Message box

Posted: Sat May 16, 2020 4:49 am
by anmldr
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

Re: [SOLVED] Message box

Posted: Sat May 16, 2020 6:29 pm
by jacque
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.