Difference between revisions of "MessageLog"
Jump to navigation
Jump to search
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. | ||
− | + | == Example == | |
− | <syntaxhighlight>MessageLog(.1); | + | <syntaxhighlight>MessageLog(.1);</syntaxhighlight> |
− | spaces inserted | + | Will display 0.10 in the PowerLanguage Editor Output Log, with three leading spaces inserted. |
− | |||
− | |||
− | |||
− | 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]] |
Revision as of 10:15, 9 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.
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.