Msg
The Msg function opens a small dialog window to show a message.
|
|
bOK = Msg( 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 true if the [OK] button is clicked.
If the dialog is canceled, false is returned.
The Msg 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 Msg (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 Msg2 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 .. concatenation operator to append pieces of the format string, which is then spread over multiple lines for greater readability.
|
|
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.