This function is the watch dog of this FTP Service.
After every FTP function is performed, return codes, error codes and messages are stored internally.
This function retrieves the last error code generated by a FTP function call.
Extended error codes and messages are generated during each API call.
This extended information is also stored after each function call.
If
llShowMessage is set to
.T.
, a message box will be displayed showing the last error code with the text relating to that error code.
Also the extended error code and message is displayed.
Most of the time, the
FTP_SERVICE::nResult_Code will be
0
if the function succeded.
In some cases, the
FTP_SERVICE::nResult_Code
will be different than
0
if the function succeded.
For example, this function returns
ERROR_NO_MORE_FILES
after the function
FTP_SERVICE::GetFTPDirectoryArray()
succeds.
So it is important to check to see if the function succeded and then check the error codes.
Parameter
-
llShowMessage
-
Show message?
Type |
Boolean |
Direction |
Input |
Set to .T.
to display a MessageBox on the screen.
Returns the error code from the last FTP function as a numeric value.
Source Code
LPARAMETERS llShowMessage
LOCAL lcMessage
IF llShowMessage = .T.
* Build Error Message Here
lcMessage = "Error (" + ALLTRIM(STR(This.nResult_Code)) + ") - " + ;
This.GetErrorText(This.nResult_Code)
IF !EMPTY(This.cExtended_Message)
lcMessage = lcMessage + CHR(13) + CHR(13) + "Extended Error Info - (" + ;
ALLTRIM(STR(This.nExtended_Result)) + ;
") - " + This.cExtended_Message
ENDIF
=MESSAGEBOX(lcMessage, 48, "FTP Error Message")
ENDIF
RETURN This.nResult_Code