/MACRO

Macro Processor commands.

/MACRO/EXEC mname [ margs ]

MNAME C Macro name
MARGS C Macro arguments D=' ' Separate

Execute the command lines contained in the macro MNAME. As a file can contain several macros, the character '#' is used to select a particular macro inside a file as explained below.

If MNAME does not contain the character '#', the file MNAME.KUMAC is searched and the first macro is executed (it may be an unnamed macro if a MACRO statement is not found as first command line in the file).

If MNAME is of the form FILE#MACRO, the file named FILE.KUMAC is searched and the macro named MACRO is executed.

Examples:

EXEC ABC to exec first (or unnamed) macro of file ABC.KUMAC EXEC ABC#M to exec macro M of file ABC.KUMAC

The command MACRO/DEFAULTS can be used to define a directory search path for macro files.

/MACRO/LIST [ mname ]

MNAME C Macro name pattern D=' '

List all macros in the search path defined by MACRO/DEFAULTS. Macros are files with the extension KUMAC. MNAME may be specified to restrict the list to the macros containing such a string in the first part of their name. For example,

MACRO/LIST ABC

will list only macros starting with ABC.

/MACRO/TRACE [ option level ]

OPTION C Option D='ON'
LEVEL C Level D=' '

OPTION:

'ON'
'OFF'

LEVEL:

'' ''
'TEST'
'WAIT'
'FULL'
'DEBUG'

Set ON/OFF the trace of commands during macro execution. If TRACE='ON' the next command is written on the terminal before being executed. If LEVEL='TEST' the command is only echoed but not executed. If LEVEL='WAIT' the command WAIT is automatically inserted after the execution of each command. The startup values are OPTION='OFF' and LEVEL=' '.

/MACRO/DEFAULTS [ path option ]

PATH C Search path for macro files D='?'
OPTION C Automatic EXEC D='?'

OPTION:

'?' show current setting
'Command' search for commands only
'C' same as 'Command'
'Auto' search for commands before macros
'A' same as 'Auto'
'AutoReverse' search for macros before commands
'AR' same as 'AutoReverse'

Set or show MACRO search attributes.

On Unix and VMS systems PATH defines a comma separated list of directories in which the commands KUIP/EDIT, MACRO/EXEC, and MACRO/LIST search for macro files. For example,

MACRO/DEFAULT '.,macro,~/macro' | Unix MACRO/DEFAULT '[],[.macro],[macro]' | VMS

defines to search files first in the current directory, then in the subdirectory 'macro' of the current directory, and last the subdirectory 'macro' of the home directory.

On VM/CMS system PATH defines a comma separated list of filemodes. E.g.

MACRO/DEFAULT '*' | search all disks MACRO/DEFAULT 'A,C' | search only disks A and C

If PATH='?' the currently defined search path is shown. If PATH='.' the search path is undefined, i.e. files are search for in the current directory (A-disk on VM/CMS) only. The startup value is PATH='.'.

The search path is not applied if the file specification already contains an explicit directory path or if it starts with a '-' character (which is stripped off).

OPTION allows to define whether macros can be invoked by their name only without prepending the KUIP/EXEC command:

DEFAULT -Command CMD | CMD must be a command DEFAULT -Auto CMD | if CMD is not a command try EXEC CMD DEFAULT -AutoReverse CMD | try EXEC CMD first; if not found try command CMD

The startup value is 'Command' (also reset by PATH='.').

Important note:

Inside macros the DEFAULT -A (or -AR) logic is disabled, i.e. DEFAULT -C is always assumed.

/MACRO/DATA

Application command to store immediate data into a file. Example:

Application DATA vec.dat 1 2 3 4 5 6 7 8 9 vec.dat vec/read x,y,z vec.dat