Script

FTP

The professional tool to automate FTP, SFTP, FTPS and Batch FTP

Syntax:

EXIT(exit_status)

  • exit_status (optional): exit status of the ScriptFTP process.

Remarks:

If the parameter exit_status is not used the exit status will be 0.

See also:

STOP

Example:

# Connect to FTP server
$result=OPENHOST("127.0.0.1","carl","123456")
 
# If the returned value is different than OK
# means that the command failed
IF($result!="OK")
  PRINT("Cannot connect to FTP server. Aborting.")
  EXIT(1)
END IF
 
# Change current local directory
$result=LOCALCHDIR("C:\Users\Johnny Knoxville\Documents\")
 
# If the returned value is different than OK
# means that the command failed
IF($result!="OK")
  PRINT("Cannot change current local dictory. Aborting.")
  EXIT(2)
END IF
 
# Upload the doc files in the current local directory
$result=PUTFILE("*.doc")
 
# If the returned value is different than OK
# means that the command failed
IF($result!="OK")
  PRINT("Error uploading files to FTP server. Aborting.")
  EXIT(3)
END IF
 
# Reached this points means that every
# previous command was successful.
PRINT("Done!")
 
# Close connection
CLOSEHOST
 
# If no parameter is used in EXIT
# 0 will be used as the exit status.
EXIT