Msg2
The Msg2 function opens a medium size dialog to show a message. An example is shown below.
|
|
bOK = Msg2( string, sTitle=nil ) |
string is the message to display and may contain multiple lines.
sTitle is the optional title of the dialog. If nil, a default is used.
This function returns bOK=true if the [OK] button is clicked.
If the dialog is canceled, false is returned.
The Msg2 window is a simple dialog that shows a message and returns the clicked button as boolean true/false. The script can use the returned value to make a decision after showing the message. If the message requires arguments to be formatted, use Sprintf to do the formatting in place of the string argument to Msg2 (see below).
The edit control supports cut, copy, and paste, should you need to interact with the text displayed in the message. It also scrolls if the message is larger than the visible area.
The related Msg function is similar but opens a small window. Both Msg and Msg2 use a modal message box which must be closed before the script can continue. If a modal message box is not needed, you can also use the Printf function to format text to a scrolling Edit window.
If the string uses multiple lines, the string should be formatting using the \r\n escape sequence (the so-called carriage return / line feed pair) to separate the lines.
The following code opens the message window after formatting some text using Sprintf. This statement resulted in the window shown above. Notice the use of the .. operator to concatenate the format string, which is then spread over multiple lines for greater readability.
|
|
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.