Run the script or command command .
Scripts are usually run by simply entering their name in the same way as a command is entered. However, the script is executed slightly differently if run using the Execute command. If a script is called from another script in the normal way, the called script is read in and parsed before the main script is executed. If the Execute command is used, the called script is not read in until and unless the Execute command is actually executed. This has two main applications.
; Avoid using Execute if a script is called within a loop. The script would be read in and parsed each time around the loop which is very inefficient.
Execute [/echo] <command>
/allowextbi |
|
/echo |
Command is copied to the command history drop down box in the commend shell. |
/literal |
Indicates the text in command should be read literally. This switch should be used if the complete command along with any arguments are stored in a variable, to be accessed by Execute through braced substituion. See the example for further explanation. |
/startup |
Used by initialisation scripts to indicate that a command is being executed on startup. The function CommandStatus can be used to test this state. This switch must not be used in user scripts. |
command |
Command to be executed with arguments if required. See /literal above for more information. |
Let command = 'inst npn'Then the literal flag should be used to enable the following braced substitution to work:
Execute /literal {command}Here is another example of using the literal flag. Both of the following will do the same thing:
Execute /literal "inst npn" Execute inst npnBut this will throw an error:
Execute "inst npn"The problem with the last example is that the Execute command interprets the first token in command as the actual command or script name and the remainder of command as the arguments to it. Because "inst npn" is enclosed in quotation marks, it is treated as a single item specifying the command name "inst npn" which is incorrect.
▲ Command Summary ▲ | ||
◄ EndSym | ExecuteMenu ▶ |