Making calculations with Macros

<< Click to Display Table of Contents >>

Navigation:  Macros >

Making calculations with Macros

A macro is run on the current network, via Calculation | Macro, where you select the macro file you want. It is also possible to run the macro directly from the macro editor, using Macro | Execute or the F9-key.

 

To run the macro, a copy of the network is made in the memory. This means macros can be run without affecting the current network. It also means that changes made to the settings by the macro are no longer available once the macro calculations have been completed.

 

First, a quick test is performed to make sure that the macro meets a number of basic conditions concerning commands, number of parameters and loops. If everything is OK, the macro is run.

 

The results of the calculations are written to Excel or to a text by the macro. The user can determine what data is included in the printout. He or she also has control over the spreadsheet layout. The results are not available in the current network (in the Vision editor).

 

Because the macros make use of network component names, they are often specific to a particular network. Generally, therefore, macros will not work on other networks. However, they can easily be adapted for other networks, simply by changing the component names.

 

Maximum number of iterations

The maximum number of iterations in loops like while and repeat may be limited, because a macro can not be interrupted by the user in the case of an "infinite loop". See the Options: Calculations | Macro.

 

Maximum execution time

The maximum execution time of a macro may be limited, because a macro can not be interrupted by the user in the case of an "infinite loop". See the Options: Calculations | Macro.

 

See also:

Macro editor

Macro structure and syntax

Macro commands and parameters