Internal Script Variables

Top  Previous  Next

 

Robo-FTP maintains a set of internally defined variables. These variables always begin with the % or $ symbol. You may use these variables just as you would any user variable, but assigning or changing the values of these variables using the SET or SETNUM commands is not recommended.

 

%cr The carriage return character
%crlf A string containing the carriage return and line feed characters
%comparedate Contains file date comparison result obtained by the FILECOMPARETO and FILECOMPAREFROM commands
%comparesizeContains file size comparison result obtained by the FILECOMPARETO and FILECOMPAREFROM commands
%currentlocaldir Contains the current local working folder
%currentlogfile Contains the current local script log file path name
%currentscript Full path name of the currently executing script file
%currentscriptdir Path of the folder that contains the currently executing script file
%currentsitedir Contains the current FTP site directory (as returned by FTPPWD)
%currenttracelogfileContains the current trace log file name.
%date Contains a formatted string with the current date(i.e., 02-16-13)
%datetime Contains a formatted string with the current date and time (i.e., Sat Feb 16 11.00.22 2013)
%dbrawqueryresult Contains the raw SQL query result if the DBGETRESULTS command does not recognize or cannot parse the result into individual %db_xxxx variables.
%dbqueryrows Contains the number of rows returned on the most recent DBQUERY command SQL database query
%dbqueryvariables Contains the number of variables created during the most recent DBGETRESULTS command
%difffileid Contains a numeric representation of the type of difference found on the most recent run of the GETDIFF command
%difffilename Contains the name of a file where a difference has been found on the most recent run of the GETDIFF command
%difffilepath Contains the full path a file where a difference has been found on the most recent run of the GETDIFF command
%difffiles Contains the number of file differences found on the most recent run of the DIFF command
%difffiletext Contains a text description of the type of difference found on the most recent run of the GETDIFF command
%diffnum Contains the sequence number of the file difference returned on the most recent run of the GETDIFF command
%downloadcountContains the number of files downloaded during the previous RCVFILE command
%downloaderrors Contains the number of file I/O errors that may have occurred when downloading with the most recent RCVFILERCVFILE command
%downloadsize Contains the number of bytes in the most recent file downloaded with the RCVFILE command
%ftpdifffileid Contains a numeric representation of the type of difference found on the most recent run of the FTPGETDIFF command
%ftpdifffilename Contains the name of a file where a difference has been found on the most recent run of the FTPGETDIFF command
%ftpdifffilepath Contains the full path of a file where a difference has been found on the most recent run of the FTPGETDIFF command
%ftpdifffiles Contains the number of file differences found on the most recent run of the FTPDIFF command
%ftpdifffiletext Contains a text description of the type of difference found on the most recent run of the FTPGETDIFF command
%ftpdiffnum Contains the sequence number of the file difference returned on the most recent run of the FTPGETDIFF command
%ftpsnapshotfiles Deprecated.
%ftplastresult Contains the last numeric result code from the FTP site
%ftpresultsfileContains the name of FTP command results temporary file
%installdirContains the name of the Robo-FTP installation folder
%installverContains the version number of the currently executing instance of Robo-FTP
%lasterror Error or result code returned by the last script command run
%lasterrormsg Descriptive text of error returned by the last script command run
%lastfailedcmd Contains the last script command that generated an error. If run from a script file, it is prepended with the corresponding line number.
%lastfile Name of the last file for which a transfer was attempted
%lastpath Full path of the last file for which a transfer was attempted
%lf The line feed character
%nextcmd Character string obtained by CRON command
%nextfile File name obtained by GETNEXTFILE and GETFILEcommands
%nextfiledate File date obtained by GETNEXTFILE and GETFILE commands
%nextfiledatetimeFile date/time stamp obtained by GETNEXTFILE and GETFILE commands
%nextfilesize File size (in bytes) obtained by GETNEXTFILE and GETFILE commands
%nextfiletime File time stamp obtained by GETNEXTFILE and GETFILE commands
%nextfolder Optional folder name obtained by GETNEXTFILE and GETFILE commands
%nextpath Full path name obtained by GETNEXTFILE and GETFILE commands
%pgpdecryptfile Full path name of the output file created by the PGPDECRYPT command
%programdatadir Full path name of the current ProgramData folder
%protocol Current connection type
%serverdir Same as the %sitedir internal variable
%serverfile Same as the %sitefile internal variable
%servertype Numeric representation of the type of server Robo-FTP has connected to
%sitedir Optional directory name obtained by GETSITEFILE and FTPGETFILE commands
%sitefile File name obtained by GETSITEFILE and FTPGETFILE commands
%sitefiledate File date stamp obtained by GETSITEFILE and FTPGETFILE commands
%sitefiledatetimeFile date/time stamp obtained by GETSITEFILE and FTPGETFILE  commands
%sitefilesize File size (in bytes) obtained by GETSITEFILE and FTPGETFILE commands
%sitefiletime File time stamp obtained by GETSITEFILE and FTPGETFILE commands
%sitefolder Same as the %sitedir internal variable
%snapshotfiles Deprecated.
%synccount Contains the number of files transferred during the previous SYNC command
%time Contains the current system time (i.e., 11.00.22)
%timedate Same as %datetime
%uploadcount Contains the number of files uploaded during the previous SENDFILE command
%uploaderrors Contains the number of file I/O errors that may have occurred when uploading with the most recent SENDFILE or RCVFILE command
%unzipcount Contains the number of files unzipped during the previous UNZIP command
%uploadsize Contains the number of bytes in the most recent file uploaded with the SENDFILE command
%zipcount Contains the number of files zipped during the previous ZIP command
$ERROR_nnPredefined $ERROR constants for use with the IFERROR command
%1 - %9Variables assigned by the -p command line switch

 

 

Consider the following examples in which the use of an internal variables is shown:

 

RCVFILE "*"

SET msg = "Last file name downloaded was: " + %lastfile

MESSAGEBOX msg

MAKEDIR %datetime ;; create a folder using current date and time

 

 

See also: Variables