Passing External Values Into Command Scripts

Top  Previous  Next

 

Robo-FTP permits arguments defined on a Shortcut Target line to be passed in at load time to be used as script file variables. Up to nine arguments are supported. There are nine internally defined variables, %1 through %9, dedicated for this purpose.

 

On the Shortcut Target line, an argument is delimited by either & or % character. The following are example arguments:

 

&argument&

%different argument%

 

The first argument, reading left to right, is assigned to variable %1, the second argument is assigned to %2, and so on. For example, consider the following Shortcut Target command line.

 

"Robo-FTP.exe"  &"My Connection"&  &SENDFILE "newdata"&

 

With such a Shortcut Target line, the following script file:

 

DASHBOARDMSG "Connecting"

DIALNET %1

DASHBOARDMSG "Executing task: [" + %2 + "]"

PERFORM %2

DASHBOARDMSG "Done"

DISCONNECT

EXIT

 

... would be executed as if it was originally written as:

 

DASHBOARDMSG "Connecting"

DIALNET "My Connection"

DASHBOARDMSG "Executing task: [" + %2 + "]"

SENDFILE "newdata"

DASHBOARDMSG "Done"

DISCONNECT

EXIT

 

 

Important

This is no longer the preferred syntax. In new projects please use the -p command line switch for passing values into script files.

 

 

Related Command(s): CALL, CHAIN

See Also: Script File Variables, Launching Robo-FTP with Command Line Switches, Using Variables in Command Options