LastError
LastError contains the WIN32 error code set by various methods when these return a FALSE and fail. This value should be checked if necessary before calling another method that can set this property in case of error.
Syntax
FTPobj.LastError: STRING (read)
Example
An example which Sets the current working directory:
Function Main
Dim FTPobj as Object
'configure as needed
ip = "127.0.0.1"
port = 21
mode = FALSE
username = "anonymous"
directory = "/pub/"
'create a new ftp Connection
Set FTPobj=FTPA protocol used to transfer files between network computers..Connect (ip,21,mode,username,password)
'Set the current working directory to /pub/
RET = FTPobj.SetCurrentDirectory (directory)
if RET Then
echo "Set current directory to " + directory + " succeeded"
else
echo "failed to Set current dir: " + CStr(FTPobj.LastError)
End If
End Function