Difference between revisions of "MessageLog"

From MultiCharts
Jump to navigation Jump to search
m (Reverted edits by 176.8.90.7 (talk) to last revision by JoshM)
 
(3 intermediate revisions by 2 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 ====
+
== Usage ==
 
<syntaxhighlight>MessageLog(Expression1,Expression2,etc.)</syntaxhighlight>  
 
<syntaxhighlight>MessageLog(Expression1,Expression2,etc.)</syntaxhighlight>  
  
==== Parameters ====  
+
== Parameters ==
[[Expression]] - a string, true/false, numerical series, or numerical expression; any number of valid expressions, separated by commas, can be used  
+
:'''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:
  
A '''''string expression''''' must be enclosed in quotation marks:  
+
:::'''Expression:C:D'''
[["String Expression"]]
+
::::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.  
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:  
+
:::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.  
[[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.  
 
 
   
 
   
==== Example ====
+
== Notes ==
<syntaxhighlight>MessageLog(.1); will display  0.10 in the PowerLanguage Editor Output Log, with three leading  
+
* MessageLog is the equivalent of [[Print]].
spaces inserted  
+
== Example ==
 
+
<syntaxhighlight>MessageLog(.1);</syntaxhighlight>
MessageLog(1.555555:6:3);  will display 1.556 in the PowerLanguage Editor Output Log, with one
+
Will display  0.10 in the PowerLanguage Editor Output Log, with three leading spaces inserted.
leading space inserted
 
  
MessageLog("Current Time is:",CurrentTime:5:0); will display the string expression
+
<syntaxhighlight>MessageLog(1.555555:6:3);</syntaxhighlight>
"Current Time is:", followed by the output of the CurrentTime, with one leading space inserted, in
+
Will display 1.556 in the PowerLanguage Editor Output Log, with one leading space inserted.
the PowerLanguage Editor Output Log</syntaxhighlight>
 
  
 +
<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.
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.