Command Syntax

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming >

Command Syntax

 

Robo-FTP automation relies on the execution of script commands. Script command syntax involves an opcode followed by arguments and then options. The general format of a Robo-FTP script command is shown below:

 

opcode [argument1] … [argumentN] /option1 … /optionN

 

 

Arguments

Arguments are one of the following types:

 

an alpha-numeric string constant (must be enclosed in single or double quotes)
a numeric constant
a variable (names starting with alphabetic character, %, or $ symbol)

 

 

Optional Arguments

Most script command arguments are required, even if you are only passing an empty string. If a script command argument is truly optional that fact will be explicitly stated in this manual.

 

 

Options

Options begin with the slash "/" character. Options may include a value assignment with the syntax /option=value where the value is:

 

an alpha-numeric string constant (may be enclosed in single or double quotes)
a numeric constant
a variable (names starting with alphabetic character, %, or $ symbol)

 

String constants passed to command options may be enclosed in quotes. When the value of a command option is enclosed in quotes it is parsed as a string constant. When the value of a command option is not enclosed in quotes, the script parser checks for a variable with the same name; if no variable is found then the value is used as a string constant.

 

Important

Although this manual contains numerous examples of string constants passed to options without using quotes, script parsing errors can occur when special characters that are significant to the parsing logic are not enclosed in quotes. The character constants that should be used inside quotes are: space, left square bracket, right square bracket, single quote, double quote, semicolon, and asterisk.

 

The password option in the following example contains a space character so it must be enclosed in quotes:

 

FTPLOGON "ftp.MyServer.com" /user=Bob /pw=My Secret ;; error invalid argument!

FTPLOGON "ftp.MyServer.com" /user=Bob /pw="My Secret"

 

An invalid argument parsing error occurs in the first row (without the quotes) because the script parser sees the value of the password option as "My" and the remaining "Secret" as an invalid argument.

 

See also: List of Script Commands, Translating Command-Line FTP Instructions