Sample code for 30+ languages & platforms
Visual FoxPro

Transition from Imap.Search to Imap.QueryMbx

Provides instructions for replacing deprecated Search method calls with QueryMbx.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loImap
LOCAL lcCriteria
LOCAL lnBUid
LOCAL loMsgSetObj
LOCAL loMset

lnSuccess = 0

loImap = CreateObject('Chilkat.Imap')

* ...
* ...

lcCriteria = "FROM bob@example.com"
lnBUid = 1

* ------------------------------------------------------------------------
* The Search method is deprecated:

loMsgSetObj = loImap.Search(lcCriteria,lnBUid)
IF (loImap.LastMethodSuccess = 0) THEN
    ? loImap.LastErrorText
    RELEASE loImap
    CANCEL
ENDIF

* ...
* ...

RELEASE loMsgSetObj

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

loMset = CreateObject('Chilkat.MessageSet')
lnSuccess = loImap.QueryMbx(lcCriteria,lnBUid,loMset)
IF (lnSuccess = 0) THEN
    ? loImap.LastErrorText
    RELEASE loImap
    RELEASE loMset
    CANCEL
ENDIF

RELEASE loImap
RELEASE loMset