Sample code for 30+ languages & platforms
Visual FoxPro

Transition from Imap.FetchSingle to Imap.FetchEmail

Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loImap
LOCAL loEmailObj
LOCAL lnHeaderOnly
LOCAL loEmail

lnSuccess = 0

loImap = CreateObject('Chilkat.Imap')

* ...
* ...

* ------------------------------------------------------------------------
* The FetchSingle method is deprecated:

loEmailObj = loImap.FetchSingle(1,0)
IF (loImap.LastMethodSuccess = 0) THEN
    ? loImap.LastErrorText
    RELEASE loImap
    CANCEL
ENDIF

* ...
* ...

RELEASE loEmailObj

* ------------------------------------------------------------------------
* Do the equivalent using FetchEmail.
* Your application creates a new, empty Email object which is passed 
* in the last argument and filled upon success.

lnHeaderOnly = 0

loEmail = CreateObject('Chilkat.Email')
lnSuccess = loImap.FetchEmail(lnHeaderOnly,1,0,loEmail)
IF (lnSuccess = 0) THEN
    ? loImap.LastErrorText
    RELEASE loImap
    RELEASE loEmail
    CANCEL
ENDIF

RELEASE loImap
RELEASE loEmail