MessageLog: Difference between revisions
From MultiCharts
No edit summary |
m (Reverted edits by 176.8.90.7 (talk) to last revision by JoshM) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Displays one or more specified expressions in the PowerLanguage Editor Output Log. Any combination of string, true/false, numerical series, or numerical expressions can be specified. | Displays one or more specified expressions in the PowerLanguage Editor Output Log. Any combination of string, true/false, numerical series, or numerical expressions can be specified. | ||
== Usage == | |||
<syntaxhighlight>MessageLog(Expression1,Expression2,etc.)</syntaxhighlight> | <syntaxhighlight>MessageLog(Expression1,Expression2,etc.)</syntaxhighlight> | ||
== Parameters == | |||
:'''Expression''' - a string, true/false, numerical series, or numerical expression; any number of valid expressions, separated by commas, can be used. | |||
::A string expression must be enclosed in quotation marks, for example ''MessageLog("Hello World!")''. | |||
::A numerical expression can be formatted to specify the minimum number of characters, including the decimal point, and the number of decimal places, to be used for the output: | |||
:::'''Expression:C:D''' | |||
::::Where: | |||
:::::'''C''' - minimum number of characters, | |||
:::::'''D''' - number of decimal places. | |||
:::The default output format for a numerical expression is two decimal places and a minimum of seven characters. | |||
:::If the number of decimal places in the numerical expression is more than the specified number, the value will be will be rounded off to the specified number of decimal places. | |||
:::If the number of characters in the output is less than the specified minimum, leading spaces will be added to bring the output to the specified minimum value. | |||
The default output format for a numerical expression is two decimal places and a minimum of seven characters. | |||
If the number of decimal places in the numerical expression is more than the specified number, the value will be will be rounded off to the specified number of decimal places. | |||
If the number of characters in the output is less than the specified minimum, leading spaces will be added to bring the output to the specified minimum value. | |||
==== | == Notes == | ||
<syntaxhighlight>MessageLog(.1);</syntaxhighlight> | * MessageLog is the equivalent of [[Print]]. | ||
== Example == | |||
<syntaxhighlight>MessageLog(.1);</syntaxhighlight> | |||
Will display 0.10 in the PowerLanguage Editor Output Log, with three leading spaces inserted. | |||
<syntaxhighlight>MessageLog( | <syntaxhighlight>MessageLog(1.555555:6:3);</syntaxhighlight> | ||
Will display 1.556 in the PowerLanguage Editor Output Log, with one leading space inserted. | |||
<syntaxhighlight>MessageLog("Current Time is:",CurrentTime:5:0);</syntaxhighlight> | |||
Will display the string expression "Current Time is:", followed by the output of the CurrentTime, with one leading space inserted, in the PowerLanguage Editor Output Log. | |||
[[Category:Output]] | [[Category:Output]] |
Latest revision as of 13:12, 13 February 2012
Displays one or more specified expressions in the PowerLanguage Editor Output Log. Any combination of string, true/false, numerical series, or numerical expressions can be specified.
Usage
MessageLog(Expression1,Expression2,etc.)
Parameters
- Expression - a string, true/false, numerical series, or numerical expression; any number of valid expressions, separated by commas, can be used.
- A string expression must be enclosed in quotation marks, for example MessageLog("Hello World!").
- A numerical expression can be formatted to specify the minimum number of characters, including the decimal point, and the number of decimal places, to be used for the output:
- Expression:C:D
- Where:
- C - minimum number of characters,
- D - number of decimal places.
- Where:
- Expression:C:D
- The default output format for a numerical expression is two decimal places and a minimum of seven characters.
- If the number of decimal places in the numerical expression is more than the specified number, the value will be will be rounded off to the specified number of decimal places.
- If the number of characters in the output is less than the specified minimum, leading spaces will be added to bring the output to the specified minimum value.
Notes
- MessageLog is the equivalent of Print.
Example
MessageLog(.1);
Will display 0.10 in the PowerLanguage Editor Output Log, with three leading spaces inserted.
MessageLog(1.555555:6:3);
Will display 1.556 in the PowerLanguage Editor Output Log, with one leading space inserted.
MessageLog("Current Time is:",CurrentTime:5:0);
Will display the string expression "Current Time is:", followed by the output of the CurrentTime, with one leading space inserted, in the PowerLanguage Editor Output Log.