6.3.2 Macro Directives

Beside plain definitions of parameter settings, a macro definition may contain a couple of additional commands called 'macro directives'. The macro processor recognized these directives and handles them separately. Directives all are lower case words starting with a percent character. The following directives are recognized:

%def

The %def directive defines a substitution parameter. The macro processor knows ten substitution parameters called 0..9. They work similar to parameters in shell scripts (Linux) or batch files (Windows). Any sequence of a percent character followed by a digit (%0 .. %9) in the macro gets substituted by the value defined in a %def directive before. The syntax of the %def directive is

%def [0..9] substitution text

For example, ' %def 4 KSTAR-2 ' sets the substitution parameter '4' to the value 'KSTAR-2'. The character sequence '%4' gets replaced by 'KSTAR-2' in all equipment settings the follow this line in the macro. The substitution parameters are initially empty.

%inc

The %inc directive includes another macro definition at it's place when the macro is played. The syntax of the %inc directive is

%inc macro-name

You may nest the execution of macros up to eight levels deep using this directive. If the macro you reference does not exist, the directive is silently ignored.

A common practice of using included macros is to record basic equipment settings into a set of macros. Using the macro editor you can then create "super macros" which first call one ore more of the basic macros and finally set a couple of settings like the channel frequency or the transmit power explicitly.

%wait

The %wait directive lets you pause the execution of a macro for some time. The syntax of the %wait directive is

%wait msecs

where msecs is the time to pause in milliseconds. The paragraph ' Timing Issues ' below explains why delays in the macro execution may be helpful.