<< Click to Display Table of Contents >> Navigation: 3. Script Language > Input- and Output commands > Input and Output Commands |
MiniRobotLanguage (MRL)
MBT. Command
MessageBoX Timed
Intention
Display a message box containing a text string and optional title. This Messagebox will disappear automatically after an given amount of time.
The easiest usage is:
MBT.
And this is the result:
You can give an Text for the Message like this:
MBT.Hello world!
And here is the result
And you can add a window title like this:
MBT.Hello world!|My Hello-Box will close in %t seconds.
which looks like this:
Then you can change the number of seconds, the Messagebox will stay before it is automatically closed. In this case we choose 32 seconds:
MBT.Hello world!|My Hello-Box will close in %t seconds.|32
Next you can change the number of button or the appearance of the messagebox.
MBT.Hello world!|My Hello-Box will close in %t seconds.|32|48
And here are some results:
Flag: 32
Flag: 48
Flag: 16
If you combine the flags, you get something like this:
MBT.Hello world!|My Hello-Box will close in %t seconds.|32|(48+3)
Flag: 48+3
See more options below.
MBX. can also be used for Debugging. If you want to see the value of a variable at some place, you can just write:
' Check variable content
MBX.$$TXT
Important note: Robot-Messageboxes are always TopMost. They will be in front of all non TopMost windows. This is necessary, because the Editor can be set to TopMost, and in this case the Messageboxes must be shown on Top of the Editor to be seen.
Syntax
MBT.P1[|P2][|P3][|P4]
Parameter Explanation
P1 - (optional) Text may contain systemvariables, like
for example $crlf$, which will force a newline.
P2 - (optional) - Window-Title Text. If omitted,
"Message/Nachricht" is used.
P3 - (optional) numeric Value, time in seconds, before
Messagebox will be automatically closed.
P4 - (optional) numeric Value, see below.
Values for P2 change the number and Text of the displayed buttons:
00 Display OK button (default)
01 OK and Cancel
02 Abort, Retry and Ignore
03 YES, NO and CANCEL
04 YES and NO
05 Retry and Cancel
06 Cancel, Retry and Continue
Add this to get a additional Help-Button:
12288 Help-Button
Add this values to change the Graphic displayed:
16 Serious problem
32 Question mark
48 Exclamation mark
64 Information (default)
Add this value to set the default button:
0 Default Button is Button Nr. 1
256 Default Button is Button Nr. 2
512 Default Button is Button Nr. 3
768 Default Button is Button Nr. 4
Add this value to change the Screen-Arrangement of the Messagebox:
0 Application Modal
4096 System-Modal
8192 Taskmodal
262144 TopMost (default and always set.)
524288 Right align Window-Text
1048576 Right align Window-Title
Add this numbers to change Focus:
32768 No Focus
65536 Set Foreground Window
131072 Desktop
P5 - (optional) - Variable that will contain the result of
the User-Input. If omitted, TOS is used.
The returned values are:
OK - 1
Cancel - 2
Abort - 3
Retry - 4
Ignore - 5
Yes - 6
No - 7
TimeOut - 0
In case of Timeout, the result is zero (0) and the Timeout-Flag is set.
Example
' A Messagebox will appear, Text is "Hallo"
' Title is Default Title
MBT.Hallo
' A Messagebox will appear, Text is "Hallo"
' Title is "MyTitel"
MBT.Hallo||MyTitle
: $$INP=My Hello-Box will close in %t seconds.
MBT.Hello world!|$$INP|5|(48+3)|$$TXT
MBT.$$TXT
ENR.
Remarks
-
Limitations:
The Parameters may not have the "|" inside as it is used a Separator.
See also: