Sample code for 30+ languages & platforms
Visual FoxPro

Transition from Imap.FetchSequenceHeaders to Imap.FetchRange

Provides instructions for replacing deprecated FetchSequenceHeaders method calls with FetchRange.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loImap
LOCAL lnStartSeqNum
LOCAL lnCount
LOCAL loBundleObj
LOCAL lnHeadersOnly
LOCAL loBundleOut

lnSuccess = 0

loImap = CreateObject('Chilkat.Imap')

* ...
* ...

lnStartSeqNum = 1
lnCount = 5

* ------------------------------------------------------------------------
* The FetchSequenceHeaders method is deprecated:

loBundleObj = loImap.FetchSequenceHeaders(lnStartSeqNum,lnCount)
IF (loImap.LastMethodSuccess = 0) THEN
    ? loImap.LastErrorText
    RELEASE loImap
    CANCEL
ENDIF

* ...
* ...

RELEASE loBundleObj

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

lnHeadersOnly = 1

loBundleOut = CreateObject('Chilkat.EmailBundle')
lnSuccess = loImap.FetchRange(lnHeadersOnly,lnStartSeqNum,lnCount,loBundleOut)
IF (lnSuccess = 0) THEN
    ? loImap.LastErrorText
    RELEASE loImap
    RELEASE loBundleOut
    CANCEL
ENDIF

RELEASE loImap
RELEASE loBundleOut