Macro Format

<< Click to Display Table of Contents >>

Navigation:  Macros > Macro commands and parameters > Macro reporting commands >

Macro Format

There is no command for defining a format for printing the numbers and texts. The format is indicated directly behind a value or variable at a write or text command.

 

Aim:

Format of a value to a fixed presentation format in order to be printed of presented in a table.

 

General notation:

NumericalValue:MinLength

or:

NumericalValue:MinLength:Decimals

or:

TextValue:MinLength

or:

Textvalue:MinLength:MinLengthBehind

 

The use of a format is optional.

 

It is possible to influence the presentation of values by defining a format. For a numerical value is possible to define the length and the number of decimals by writing these immediately behind the value, preceded by colon: NumericalValue:MinLength or NumericalValue:MinLengt:Decimals. NumericalValue is a numerical value. MinLength is an integer value, indicating the minimum length of the numerical presentation. If without format the normal numerical presentation would be shorter, spaces would have been added to the front. In that case the presentation is no longer numerical, but alphanumerical.

For alphanumeric values the length can be given up similarly: TextValue:MinLength or TextValue:MinLength:MinLengthBehind. In the first case spaces are added to the front until the total length amounts to MinLength. In the second case spaces to MinLengthBehind are added to the back firstly and afterwards spaces to the front to MinLength.

Formatting with length is mainly useful when reporting column-oriented in text values.

 

Example:

Loadflow(0,,true,false)

Set(NNN,Node('Station 1'))

Text('>',NNN.Name:20,'<')

Text('<',NNN.Name:20:10,'<')

Text('<',NNN.Name:20:20,'<')

Text('<',NNN.Upu:8:2,'<')

 

yields:

>           Station 1<

>          Station 1 <

>Station 1           <

>    1,01<

 

A table can be created using the format. For example, see next macro, applied on the demonstration network 'demo.vnf':

 

Loadflow(0,,true,false)

Text('Node name            Voltage')

Text('                        [pu]')

Text('============================')

For(Node,NNN)

 Text(NNN.Name:20:20,NNN.Upu:8:2)

End

 

Yields the next table:

 

Node name            Voltage

                       [pu]

============================

HS-Station              1,05

MS-Station              1,04

Station 1               1,01

Station 4               1,03

Station 3, rail A       0,99

Hoofdrail               1,04

TS                      1,02

Station 3, rail B       0,99

Hoofdrail               1,04

Molen 2                 1,04

Molen 1                 1,02

 

 

See also:

Addsheets

GetSheets

Title

GetTitle

Write

Copy

Bold

Border

Merge

Fit

Align

Color

Backcolor

 

Text

 

Back to reporting commands.