Jump to content
Developer Wiki and Function Reference Links ×

accessing the message bar from vectorscript


Recommended Posts

Hi,

I try to put out some Info via the message bar. (i actually am thinking about some kind of progress bar)

Unfortuntately their doesn't appear any text in the message bar...

any ideas?

(it's the first example script from the developer-page) 😉

 

Quote

PROCEDURE FirstExample;
CONST
   kGREETING = 'Hello ';
VAR
   MyMessage : STRING;
BEGIN
   myMessage:='Script';

   Message(kGREETING);
   Wait(5);
   SysBeep;
   ClrMessage;
END;
RUN(FirstExample);

 

Link to comment
1 minute ago, matteoluigi said:

Hi,

I try to put out some Info via the message bar. (i actually am thinking about some kind of progress bar)

Unfortuntately their doesn't appear any text in the message bar...

any ideas?

(it's the first example script from the developer-page) 😉

 

 

 

Even in C++-Code, it can happen that you do not see the text if VW has no time to draw it.

Link to comment

The Message command "stopped working" a few versions ago in that it does not operate during a Vectorscript, but only at the end of the script. At least that is my memory.

 

You can either use AlrtDialog, and require the user to hit enter to proceed. (this is my go to for debugging) Or you can try AlertInform and set it to be a minor alert. The problem with that is the second time you call AlertInform it ignores the Minor and pops up a dialog box instead of just putting the information into the message bar.

 

If you really feel you need a progress indicator you might be better off in Python and use Python objects instead of VW objects.  +1 to @JBenghiat ;-)

Link to comment

Message is floating palette, not the message bar. Currently, Message usually won't display until after the script runs. It can be useful for quick debugging.

 

There are a number of built-in routines for showing a progress bar dialog. You can also show alerts in the message bar with AlertInform(), but only if the user has opted to display minor alerts i the message bar (you could get and save the preference, set the preference to show minor alerts, and then restore).

  • Like 2
Link to comment

Actually, the Message command is still working, badly.  Typically, it will fail to deploy if there are any alerts or dialogs in the command that you are running.  It is not reliable to code.  That is if you have no alerts or dialogs the message window may still not deploy; however, if you see it deploy when running a command, it will be consistent for that command (unless you edit and change it).  I have several commands that use the message window to show options to use while a command is running, but I have to check them with every new version of VW.

Link to comment
14 hours ago, Pat Stanford said:

The Message command "stopped working" a few versions ago

btw, the first in the introduction of vector script is basing mainly on the Message-command. I'm sure, the page hasn't been touched for a rather long time, however, a quite unsatisfying "first script" for beginners ;-).

Link to comment

The message box hasn’t stopped working, it just doesn’t update until the end of the script. For quick debugging, where you just need to display a single value or result, it still works great. It definitely won’t work for a progress indicator, though. 
 

python won’t really help you in this case either. Your options are still using the progress dialog or having a minor alert in the message bar. In general, though, unless you’re already very familiar with VectorScript, I recommend working with python. 

Link to comment
On 10/26/2020 at 1:26 PM, Pat Stanford said:

The Message command "stopped working" a few versions ago in that it does not operate during a Vectorscript, but only at the end of the script. At least that is my memory.

 

You can either use AlrtDialog, and require the user to hit enter to proceed. (this is my go to for debugging) Or you can try AlertInform and set it to be a minor alert. The problem with that is the second time you call AlertInform it ignores the Minor and pops up a dialog box instead of just putting the information into the message bar.

 

If you really feel you need a progress indicator you might be better off in Python and use Python objects instead of VW objects.  +1 to @JBenghiat 😉

 

So THAT'S why so many of my scripts don't report what they used to.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...