CHAIN Transfer control to a new script file |
Top Previous Next |
Use of this script command transfers control to another script file. Control does not return to the original script file.
Arguments may be passed to a called script using the &..& syntax. Any strings found between two & delimiters are saved in sequence in internal variables named %1 through %9 which are then accessible within the chained to script. The following example passes two arguments.
CHAIN "called_script.s" &arg1& &arg2&
When the new script is running, it will find %1 = “arg1” and %2 = “arg2”.
Consider the following example where a variable has been previously saved to determine which of two script files are to be executed.
IFSTRCMP which_one "its2" goto chain_to2 CHAIN "script1.s" :chain to2 CHAIN "script2.s"
Related Command(s): CALL, EXEC , WORKINGDIR
|