CALL        Execute script file and return

Top  Previous  Next

Syntax:

CALL

[ file name ]  |  [ /options ]

Arguments:

[ file name ]

Variable or string defining a file or path name; if no path is defined        Robo-FTPs working folder is used.

Options:

/silent

Do not echo script commands or results to log file or Robo-FTP window.

 

&arg&

Up to nine arguments may be passed to the called script in the same manner that they may be passed from the command line into Robo-FTP when it is launched; the first argument is saved in script variable %1, the second in %2, etc. up to %9.

 

 

Use of this script command temporarily transfers control to another script file. 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"

 

The called script file might contain the following.

 

MESSAGEBOX "now running called_script.s"

RETURN

 

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 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