Visual FoxPro
Visual FoxPro
Transition from Imap.ThreadCmd to Imap.QueryThread
Provides instructions for replacing deprecated ThreadCmd method calls with QueryThread.Chilkat Visual FoxPro Downloads
LOCAL lnSuccess
LOCAL loImap
LOCAL lcThreadAlg
LOCAL lcCharset
LOCAL lcSearchCriteria
LOCAL lnBUid
LOCAL loJsonObj
LOCAL loJson
lnSuccess = 0
loImap = CreateObject('Chilkat.Imap')
* ...
* ...
lcThreadAlg = "REFERENCES"
lcCharset = "UTF-8"
lcSearchCriteria = "SUBJECT a"
lnBUid = 1
* ------------------------------------------------------------------------
* The ThreadCmd method is deprecated:
loJsonObj = loImap.ThreadCmd(lcThreadAlg,lcCharset,lcSearchCriteria,lnBUid)
IF (loImap.LastMethodSuccess = 0) THEN
? loImap.LastErrorText
RELEASE loImap
CANCEL
ENDIF
* ...
* ...
RELEASE loJsonObj
* ------------------------------------------------------------------------
* Do the equivalent using QueryThread.
* Your application creates a new, empty JsonObject object which is passed
* in the last argument and filled upon success.
loImap.SearchCharset = "UTF-8"
loJson = CreateObject('Chilkat.JsonObject')
lnSuccess = loImap.QueryThread(lcThreadAlg,lcSearchCriteria,lnBUid,loJson)
IF (lnSuccess = 0) THEN
? loImap.LastErrorText
RELEASE loImap
RELEASE loJson
CANCEL
ENDIF
RELEASE loImap
RELEASE loJson