Constants

Top  Previous  Next

 

Alphanumeric Constants

Alphanumeric constants are character string values that may be used directly in the arguments and options of script commands or assigned to script variables. Quotation marks around string constants are required for command arguments but not for command options. The FTPLOGON command in the following example takes one argument for the remote site address and it also supports multiple options that define a connection.

 

FTPLOGON "www.robo-ftp.com" /user=anonymous  

 

The Robo-FTP script parser allows string constants to be enclosed in either single or double quotes providing that the opening quote character matches the closing quote character.

 

FTPLOGON "www.robo-ftp.com" /user=anonymous   ;; valid syntax

FTPLOGON 'www.robo-ftp.com' /user=anonymous   ;; valid syntax

FTPLOGON "www.robo-ftp.com' /user=anonymous   ;; INVALID mixing of quote characters

 

In the examples above, the string constant "anonymous" is sent to the remote server for user authentication. When an alphanumeric constant without quotes is passed to a command option, the script parser first checks for the existence of a variable with the same name. Consider the following example:

 

SET anonymous = "JohnDoe"

FTPLOGON "www.robo-ftp.com" /user=anonymous

 

In the example above, the string "JohnDoe" is sent to the remote server for user authentication because the parser recognizes anonymous as the name of an existing  variable.  

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.

 

 

Numeric Constants

Numerals may be passed without surrounding quotation marks to the arguments and options of some script commands. Numeric constants differ from alphanumeric constants in that the enclosing single or double quotation marks are optional. Here are some examples of numeric constants used without quotes:

 

SET x = 1

SETNUM y = 2 + 2

NATO 60