Programmer Guide/Macro Library/UM: Difference between revisions

From STX Wiki
Jump to navigationJump to search
(initial import)
 
No edit summary
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:UM or EM - Display a User-Message (UM) or Error-Message (EM)}}
==UM [message]==
UM <var>text</var> [; <var>title</var> ]
 
:Display the argument <var>text</var> in a message box with caption <var>title</var> (default: <code>UM</code>) and the only button <code>OK</code>. This function is a shortcut for <code>[[Programmer_Guide/Macro_Library/BUTIL#MsgBox|BUTIL MSGBOX MSG]]</code>.
=====Usage:=====
EM [ <var>rc</var>=-1 [ <var>level</var>=2 ]] ; <var>text</var> [; <var>title</var> ]
 
:Display the string <code>ERROR (<var>rc</var>): <var>text</var></code> in a message box with caption <var>title</var> (default: <code>EM</code>) and the only button <code>OK</code>. When the dialog is closed use the command [[Programmer_Guide/Command_Reference/EXIT|<code>EXIT <var>level</var> INT <var>rc</var></code>]] to return from <var>level</var> macro levels.
<code>UM message</code>
{|class="einrahmen"
 
!argument !!description !!default
=====Parameters:=====
|-
 
|<var>text</var>
;<var>message</var>
|The message text to be displayed.
 
|
:The message to display.
|-
 
|<var>title</var>
=====Result:=====
|The caption of the message box.
 
|<code>UM</code> or <code>EM</code>
0
|-
 
|<var>rc</var>
=====Description:=====
|The return code of the EM function. This must be an integer number.
 
|<code>-1</code>
A shorthand way to display a message to the user. See the macro BUTIL MSGBOX for more functionality.
|-
 
|<var>level</var>
=====Examples:=====
| The number of macro levels to be closed (see command [[Programmer_Guide/Command_Reference/EXIT|<code>EXIT</code>]] for details)
| <code>2</code> (return to caller)
|-
!RESULT !!description
|-
|''undefined'' || for the function <code>UM</code>
|-
|<var>rc</var> || for the function <code>EM</code> (value is returned to the macro defined b< <var>level</var>)
|}


Example:
<pre>
<pre>
um Please press OK to continue
[macro umemtest]
um press OK key to continue; UM - waiting for user input
em 107; press OK to exit this macro with return code 107; EM - waiting for user input
// this point should nevel be reached!
conlog '$#mac: you should never see this message - something goes wrong!'
exit 1 int 0
</pre>
</pre>

Latest revision as of 09:38, 17 January 2017

UM text [; title ]
Display the argument text in a message box with caption title (default: UM) and the only button OK. This function is a shortcut for BUTIL MSGBOX MSG.
EM [ rc=-1 [ level=2 ]] ; text [; title ] 
Display the string ERROR (rc): text in a message box with caption title (default: EM) and the only button OK. When the dialog is closed use the command EXIT level INT rc to return from level macro levels.
argument description default
text The message text to be displayed.
title The caption of the message box. UM or EM
rc The return code of the EM function. This must be an integer number. -1
level The number of macro levels to be closed (see command EXIT for details) 2 (return to caller)
RESULT description
undefined for the function UM
rc for the function EM (value is returned to the macro defined b< level)

Example:

[macro umemtest]
um press OK key to continue; UM - waiting for user input
em 107; press OK to exit this macro with return code 107; EM - waiting for user input
// this point should nevel be reached!
conlog '$#mac: you should never see this message - something goes wrong!'
exit 1 int 0

Navigation menu

Personal tools