Option Explicit
Sub Main
Dim intReturn As Integer
' The Action2 FTP methods (with the exception of
' FTPQuickSend and FTPQuickRetrieve may not
' function properly in the AutoMate™ BASIC IDE. To
' more accurately use these functions, run the script from
' within an AutoMate™ task using the “Run a BASIC
' Script” action.
Dim varHost As Variant
Dim varUserName As Variant
Dim varPassword As Variant
Dim intPort As Integer
Dim varFTPLogFile As Variant
Dim intOverwriteLog As Integer
Dim intPassiveMode As Integer
Dim varFTPFilename As Variant
Dim intIncludeSubDirs as Integer
varHost = "www.hostname.com"
varUsername = "username"
varPassword = "password"
intPort = 21
varFTPLogFile = "c:\ftp.log"
intOverwriteLog = 1
intPassiveMode = 0
varFTPFilename = "/*.txt"
intIncludeSubDirs = 0
Action2.FTPLogin (varHost, varUsername, varPassword, intPort, varFTPLogFile, intOverwriteLog, intPassiveMode)
intReturn = Action2.FTPDelete (varFTPFilename, intIncludeSubDirs)
Action2.FTPLogout
If intReturn = 0 Then
MsgBox "Failure"
MsgBox( Action2.GetLastError )
ElseIf intReturn = 1 Then
MsgBox "Success"
End If
End Sub