Sample code for 30+ languages & platforms
Visual FoxPro

Transition from Imap.ListMailboxes to Imap.MbxList

Provides instructions for replacing deprecated ListMailboxes method calls with MbxList.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loImap
LOCAL lcReference
LOCAL lcMbxPattern
LOCAL loMboxesObj
LOCAL lnSubscribed
LOCAL loMboxes

lnSuccess = 0

loImap = CreateObject('Chilkat.Imap')

* ...
* ...

lcReference = ""
lcMbxPattern = "*"

* ------------------------------------------------------------------------
* The ListMailboxes method is deprecated:

* Lists all mailboxes, including unsubscribed.
loMboxesObj = loImap.ListMailboxes(lcReference,lcMbxPattern)
IF (loImap.LastMethodSuccess = 0) THEN
    ? loImap.LastErrorText
    RELEASE loImap
    CANCEL
ENDIF

* ...
* ...

RELEASE loMboxesObj

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

* Lists all mailboxes, including unsubscribed.
lnSubscribed = 0

loMboxes = CreateObject('Chilkat.Mailboxes')
lnSuccess = loImap.MbxList(lnSubscribed,lcReference,lcMbxPattern,loMboxes)
IF (lnSuccess = 0) THEN
    ? loImap.LastErrorText
    RELEASE loImap
    RELEASE loMboxes
    CANCEL
ENDIF

RELEASE loImap
RELEASE loMboxes