Cancel Method

Cancels the current operation.

Syntax

object.Cancel()

The object placeholder represents an expression that evaluates to a FileTransfer object.

Return Type

Integer

Remarks

The Cancel method cancels the current operation, returning control to the application. This method is typically used to either cancel a file transfer, file listing, or connection attempt. Once the operation has been canceled, the OnCancel event will fire.

This method will return a value of zero if the action was successful. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

In addition to the generation of an OnCancel event, the cancelled operation may return a non-zero error code, or throw an error.

Example

Private Sub cmdCancel_Click()
    Dim nError As Long
    
    nError = FileTransfer1.Cancel()
    If nError <> 0 Then
        MsgBox "Cancel error: " & nError
    End If
End Sub

See Also

Reset Method, OnCancel Event


Copyright © 2008 Catalyst Development Corporation. All rights reserved.