The statements in a macro usually have parameters that need to be
assigned values. Wintrack gives each macro 16 parameter registers
which can be assigned parameter values when the macro is run. In your
macro statements, you can replace explicit parameter values by place
holders that refer to parameter registers and thereby defer the
specification of values to the moment when you actually run the macro.
Provided that you call a macro using the Run
Macro command, you can include a [dialogs] section in the macro
that runs a selection of command dialogs and writes the specified
parameter values to parameter registers. These dialogs run before the
[main] section of the macro is executed. This is how it works:
Command Param_1={1} Param_2=value
Command Param_1={1}{2}
Command Param_1={3} Param_2=value
In the [main] section of the macro, for some or all parameter assignments
instead of typing values, type place holders, that is, numbers framed
by brackets. Make sure not to use numbers greater than 16. You can assign
the same place holder to two or more parameters within the same or in
different commands if you want them all to be always assigned the same
value as the macro is executed. You can also combine place holders to
make up for one parameter value.
Command /d/Param_1 Param_2
GetParam {1} Param_1
Command /dh/Param_1 /d/Param_2=default
GetParam {2} Param_1
GetParam {3} Param_2
In the [dialogs] section of the macro, include a command statement
for each pre-dialog which is to be run. This will actually not execute
a command, but merely run its dialog, so the user can enter parameters.
Place a dialog prefix /d/ in front of every parameter you want
to be accessible in the dialog. Combine the dialog prefix with a history
prefix to present the most recently specified value as a default
in a field: /dh/. You can also specify an explicit default to
be presented in the dialog by specifying a value for a parameter. After
the user has entered parameter values in a macro dialog, these values
need to be stored in parameter registers. To this purpose, you place
GetParam statements immediately after the command statement that
ran the dialog. Each GetParam statement can write one specified value
to one of the parameter registers. GetParam statements have three
parameters:
GetParam {n} field_name [Take=dir]
GetParam {n} Dialog [Def=default] [Txt=title]
GetParam can also be used without first invoking a command dialog.
If you specify the keyword Dialog instead of a dialog field name, GetParam
will itself display a simple dialog with an edit box for the
user to enter text. The optional parameter Def allows to specify a default
content for the edit box. Using the Txt parameter, you may add a text
label to the edit box.