Arbortext Command Language > Functions by Alphabetical Listing > execute (Function)
  
execute (Function)
execute(cmds[, package])
This function parses and executes cmds as a sequence of Arbortext Editor commands. The result is the value of the last command executed (that is, what the $status variable is set to): 0 if success, 1 if a runtime error, or 2 if a syntax error. If there is a syntax or runtime error, the variable $ERROR gives the error message.
When called from a user-defined function, the expression is compiled within the current scope, so local variables are accessible. The argument package may be specified to change the effective package used to execute the command. By default, the current package is used.
This function does not generate error popup messages. The caller must display the message if desired. For example, the execute command could be written as an alias using this function:
alias execute {
if (execute("$*") != 0) {
beep;
response($ERROR)
}
}