$MAC
- Last UpdatedJan 05, 2026
- 2 minute read
Syntax
$MAC (Macro-name) < $1 < $2 < ... $9 > > >
or
@Macro-name < $1 < $2 < ... $9 > > >
Executes the macro with the given name. The macro can contain any valid interface or application commands. Macros can be nested and also recursive but the user is responsible for a correct exit. Each macro can be supplied with up to 999 parameters which are unique to each macro. These parameters are identified as $1, $2, ... $999, for example:
MODIFY SECTION '$1': DISPLAY POINTS: DISPLAY CURVE: QUIT
The character '*' supplied as a parameter indicates that this parameter is to take the default value defined within the macro by the $DEFAULT command, for example:
@NOTCH TBAR * 76.5
Here the parameter $2 will take the default value which must be defined within the macro.
Comments can be included within a macro by specifying a ';' as the first character on the input line. The whole line will be ignored.
Labels are defined by specifying a '%' as the first character on the input line. The next word( up to 40 characters) represents the label name. The label can be followed by a comment which will be ignored. These labels can be subsequently referenced to in $GOTO statements to change the sequence of command execution.
|
for example, |
% get_next_curve go back and process next curve |
||||
|
! |
! |
! |
! |
||
|
+-------------------------++-----------------------------------------+ |
|||||
|
! |
! |
||||
|
label |
comment |
||||
A special label with the name %HDR can be included, normally at the start of a macro, to supply a single line description of the macro. This will be displayed when the $DIRECTORY command is used, for example:
%HDR Create notch macro $1=Type, $2=Width, $3=Height
Whenever an application starts up, and before the interface prompts for the first command, an automatic search is made for an initialization macro. This is named 'nnnn'.INI where 'nnnn' is the name of the application. This macro is treated just like any other macro and so can contain valid application or interface commands.
The default file extension is MAC which will be appended automatically if no file extension is present.
Whenever a macro is to executed the users directory is searched for a file with the given name. If it is not found then the User Macro Library (MAC$USR) is searched and finally the System Macro Library (MAC$SYS) is searched.