PERFORM        Execute a specified script command

Top  Previous  Next

Syntax:

PERFORM

[ command ]

Arguments:

[ command ]

Variable or string defining a valid Robo-FTP script command to be executed immediately.

Options:

none

 

 

 

This script command takes a variable or string argument and executes it as if it were an inline script command. This command is handy for tasks like running a command with a dynamically constructed list of options, passing script commands as command-line arguments or executing raw commands provided by users via the PROMPT command.

 

Consider the following example of a script file that accepts commands that you type when prompted by Robo-FTP. You would type the STOP command to end script execution.

 

:loop

PROMPT var "Enter Command" "Robo-FTP Prompt Window"

PERFORM var

GOTO loop

 

Consider the following example of a Windows command line that executes Robo-FTP and passes the WORKINGDIR script command as an argument on the command line.

 

"c:\Program Files\Robo-FTP X.X\robo-ftp.exe" -p1 "WORKINGDIR 'e:\source folder\output'"

 

That will cause Robo-FTP to start with a variable named %1 that is pre-populated with the value "WORKINGDIR 'e:\source folder\output' so the variable may subsequently be used with the PERFORM command:

 

PERFORM %1

 

Notice that the Windows command line in the example above includes both single and double quote characters. The internal pair of single quotes are required around the folder path value passed to the WORKINGDIR command because it contains an internal space character that would otherwise cause a parsing issue.

 

Related command(s): EXEC, PROMPT, CALL, CHAIN

See also Passing External Values Into Command Scripts