Returning Error Codes from Scripts

<< Click to Display Table of Contents >>

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

Returning Error Codes from Scripts

When a Robo-FTP script processor exits it returns a number to the calling process indicating success or failure. Just like individual Robo-FTP script commands, a zero indicates success while other numbers indicate various errors.


1.The Robo-FTP Script Processor may return an error if it encounters a problem executing. Things like a license failure or a -s option specifying a script that doesn't exist will cause it to return an error without running any script.

2.The RETURN  flow control command. If RETURN is used in the top level script and the session is non interactive (It is running from the Scheduler or as a service) it will cause Robo-FTP to return either %lasterror if no argument is given or whatever value was specified as an argument to  RETURN. Otherwise it sets %lasterror appropriately and returns to the next calling level or stops script execution if it is already at the top level and the session is interactive.

3.The EXIT command. This will cause Robo-FTP to exit immediately with %lasterror as the return code. The /exitcode= option may be used to specify an alternative return code.

4.If the current script simply ends without either command it returns %lasterror to the calling scope. If it is the top level scope it either simply stops script execution or if the session is non interactive Robo-FTP will exit, returning %lasterror.


For details about specific script return codes see Command Result Codes.