CALL Execute script file and return |
Top Previous Next |
Use of this script command temporarily transfers control to another script file. Unlike the CHAIN command, when the called script file exits, control returns to the original script file at the statement immediately following the CALL statement.
The following is an example of calling a script file and of the script file being called.
CALL "called_script.s"
Then the end of the called script file might contain the following:
DASHBOARDMSG "Now leaving called_script.s"
Arguments may be passed to a called script using the double ampersand syntax. Any strings found between two ampersand delimiters (ie &value&) are saved in sequence in internal variables named %1 through %9 which are then accessible within the called script. The following example passes two arguments.
CALL "called_script.s" &arg1& &arg2&
When the called script is running, it will find %1 = “arg1” and %2 = “arg2”.
Note: any changes made to the Robo-FTP environment in a called script will persist after returning to the calling script. For example, if the working folder is changed the change will remain in effect upon the return. View called scripts as simply extensions to the original script, not as separate environments.
Related Command(s): CHAIN, EXEC, RETURN, WORKINGDIR |