<< Click to Display Table of Contents >> Navigation: Macros > Macro commands and parameters > Macro reporting commands > Macro write to a text > Macro command Text |
Purpose:
Write one or more values as line to a text.
General notation:
Text ( value1 [ , value2 [ , value3 ... ] ] )
The format can be specified together with the value.
It is possible to write more than one value. In that case all values are delimited with a comma. In the case that the value is an object, the commands writes to the worksheet cell: the object type, directly followed by the object name.
The text is shown on the screen after the macro has finished. The user may save the text by giving it a filename. There are no formatting commands.
Example:
Perform an n-1 contingency analysis for all branches in selection ‘MV-Network’ and present the voltage of node ‘MyNode’:
Set( year, 2006 )
Set( textline, 'Results N-1 contingency analysis year: ' )
Add( textline , year )
Text( textline )
Text( 'Failing branch: Voltage (p.u.):' )
For( Branch( 'MS-net' ), failingbranch )
Set( textline, failingbranch )
Add( textline, ' ' )
Set( failingbranch.FirstSwitch, open )
Loadflow( 0, , true )
Add(textline, Node( 'MyNode' ).Upu )
Text( textline )
Set( failingbranch.FirstSwitch, closed )
End
The example yields the next ASCII text:
Results N-1 contingency analysis year: 2006
Failing branch: Voltage (p.u.):
Link 1.0199
Cable MSStat - Stat1 circuit 1 0.9798
Cable MSStat - Stat1 circuit 2 0.9798
Cable MSStat - Stat4 circuit 2 0.9906
Cable MSStat - Stat4 circuit 1 0.9906
Cable Stat4 - Stat3 0.9505
Cable Stat4 - Main bus bar 0.9833
Cable Stat1 - Stat3 circuit 1 0.966
See also:
Back to reporting commands.