Programmer Guide/Macro Library/CONLOG: Difference between revisions

From STX Wiki
Jump to navigationJump to search
(Created page with "{{DISPLAYTITLE:ConLog - Write messages to the Console and/or the Log-window}} CONLOG [<var>line1</var> [<var>line2</var> ..]] [ <var>options</var> ] :Write the specified tex...")
 
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:ConLog - Write messages to the Console and/or the Log-window}}
{{DISPLAYTITLE:ConLog - Write messages to the Console and/or the Log-window}}
  CONLOG [<var>line1</var> [<var>line2</var> ..]] [ <var>options</var> ]
  CONLOG [<var>line1</var> [<var>line2</var> ..]] [ <var>options</var> ]
:Write the specified text-lines (<var>line1</var>, ...) to the [[User_Guide/STX_Console|Console window]] and/or the [[User_Guide/Log_Window|Log-window]]. This function can be used by scripts to write error- and progress-information to the Console. It
:Write the specified text-lines (<var>line1</var>, ...) to the [[User_Guide/STX_Console|Console window]] and/or the [[User_Guide/Log_Window|Log-window]]. This function can be used by scripts to write error- and progress-information to the Console. It


{|class="einrahmen"
{|class="einrahmen"
!argument !!description !!default
!argument !!description
|-
|-
|<var>line1</var>, <var>line2</var>, ...
|<var>line1</var>, <var>line2</var>, ...
|The text lines to be written to the window(s).
|The text lines to be written to the window(s).
|
|-
!option !!description !!default
!option !!description !!default
|-
|-
|<code>/Shell</var>
|<code>/Noconsole</code>
|Write the prefix "''appid'':''currtime'' - " before each text line. Where ''appid'' is the value of variable <code>AppName</code> and ''currtime'' is the current time (hh.mm.ss).
|Output only to the Log-window and not to the Console window.
|
-
|<code>/Shell</var>
|Write the prefix "''appid'':''currtime'' - " before each text line. Where ''appid'' is the value of variable <code>AppName</code> and ''currtime'' is the current time (hh.mm.ss).
|
<code>UM</code> or <code>EM</code>
|-
|-
|<var>rc</var>
|<code>/Shell</code>
|The return code of the EM function. This must be an integer number.
|Write the prefix <code>''appid'':''currtime'' - </code> before each text line. Where ''appid'' is the value of variable <code>AppName</code> and ''currtime'' is the current time (hh.mm.ss).
|<code>-1</code>
|-
|<code>/Error</code>
|Write the prefix <code>Error! - </code> before each text line.
|-
|<code>/Warning</code>
|Write the prefix <code>Warning! - </code> before each text line.
|-
|-
|<code>/X</code><BR><code>/X=</code><var>n
|<code>/X</code><BR><code>/X=</code><var>n
| Exit from <var>n</var> macro levels. If <code>/X</code> (eXit) is supplied without a number, the number of levels <var>n</var> is set to 2 (return to caller).
|Exit from <var>n</var> macro levels. If <code>/X</code> (eXit) is supplied without a number, the number of levels <var>n</var> is set to 2 (return to caller).
(see command [[Programmer_Guide/Command_Reference/EXIT|<code>EXIT</code>]] for details)
(see command [[Programmer_Guide/Command_Reference/EXIT|<code>EXIT</code>]] for details)
|
|-
|<code>/Ton</code>
|Turn timer on. If timer is already active, the elapsed time (since timer was started) is displayed.
|-
|<code>/Toff</code>
|Turn timer off (if active) and display elapsed time (since timer was started).
|-
|<code>/Result</code><BR><code>Result=</code><var>res</var>
|With this option the result value to be returned with the /X option can be specified. If the value <var>res</var> is not supplied, an empty string (<nowiki>''</nowiki>) is returned.
|-
|<code>/Progress</code>
|If this option is supplied, '''all other options are ignored''' and the text is written to the Console window only. The first line is written with the '''overwrite''' mode, this means the text <var>line1</var> replaces the last output line.
|-
|<code>/File=</code><var>x</var>
|Appends the text lines to the file with path <var>x</var> (opened temporary in text-append mode) or to the fileitem <var>x</var> (if <var>x</var> is the id of a textfileitem)
|-
|-
!RESULT !!description
!RESULT !!description
|-
|-
|''undefined'' || for the function <code>UM</code>
|''undefined'' || if <code>/X</code> is not supplied
|-
|-
|<var>rc</var> || for the function <code>EM</code> (value is returned to the macro defined b< <var>level</var>)
|'<var>res</var>' or <nowiki>''</nowiki> || if <code>/X</code> is supplied; the value is returned to the macro selected by the level <var>n</var> specified with the option <code>/X</code>.
|}
|}


Example:
;See also:
<pre>
[[../LOGWINDOW|LogWindow]], [[../UM|UM and EM]], [[../BUTIL#MsgBox|MsgBox]]
[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>

Latest revision as of 10:37, 15 March 2018

CONLOG [line1 [line2 ..]] [ options ]
Write the specified text-lines (line1, ...) to the Console window and/or the Log-window. This function can be used by scripts to write error- and progress-information to the Console. It
argument description
line1, line2, ... The text lines to be written to the window(s).
option description default
/Noconsole Output only to the Log-window and not to the Console window.
/Shell Write the prefix appid:currtime - before each text line. Where appid is the value of variable AppName and currtime is the current time (hh.mm.ss).
/Error Write the prefix Error! - before each text line.
/Warning Write the prefix Warning! - before each text line.
/X
/X=n
Exit from n macro levels. If /X (eXit) is supplied without a number, the number of levels n is set to 2 (return to caller).

(see command EXIT for details)

/Ton Turn timer on. If timer is already active, the elapsed time (since timer was started) is displayed.
/Toff Turn timer off (if active) and display elapsed time (since timer was started).
/Result
Result=res
With this option the result value to be returned with the /X option can be specified. If the value res is not supplied, an empty string ('') is returned.
/Progress If this option is supplied, all other options are ignored and the text is written to the Console window only. The first line is written with the overwrite mode, this means the text line1 replaces the last output line.
/File=x Appends the text lines to the file with path x (opened temporary in text-append mode) or to the fileitem x (if x is the id of a textfileitem)
RESULT description
undefined if /X is not supplied
'res' or '' if /X is supplied; the value is returned to the macro selected by the level n specified with the option /X.
See also

LogWindow, UM and EM, MsgBox

Navigation menu

Personal tools