COMMAND - create a user-defined command.

$*$COMMAND
may take several forms. In the form
$*$COMMAND name : statement
the given statement is associated with "name". Once you have given this definition, you may use statements of the form
$*$name argument argument ...
in the EXEC input. This executes the statement associated with "name", using the given arguments. You may also use $*$COMMAND in the form
$*$COMMAND name
    statements
$*$EndCommand
This associates the given statements with "name". Again, you can use
$*$name argument argument ...
to execute the block of statements, using the given arguments.

The definitions of user-defined commands are stored in memory. This means that the amount of available memory acts as a limit on the number of commands you can define.

EXEC variables are global to all user-defined commands; you cannot define "local" variables within a command.

You may not give a user-defined command the same name as any of the predefined EXEC directives. Statement blocks may NOT contain $*$COMMAND constructs of their own; in other words, you cannot nest $*$COMMAND definitions. See the section "Input Expansion" in the main explain file "expl exec" for more details that pertain to $*$COMMAND statements.

Copyright © 2000, Thinkage Ltd.