Visual FoxPro
Visual FoxPro
Transition from MailMan.FetchByMsgnum to MailMan.FetchOne
Provides instructions for replacing deprecated FetchByMsgnum method calls with FetchOne.Chilkat Visual FoxPro Downloads
LOCAL lnSuccess
LOCAL loMailman
LOCAL lnMsgnum
LOCAL loEmailObj
LOCAL lnHeaderOnly
LOCAL lnNumBodyLines
LOCAL loEmailOut
lnSuccess = 0
loMailman = CreateObject('Chilkat.MailMan')
* ...
* ...
lnMsgnum = 123
* ------------------------------------------------------------------------
* The FetchByMsgnum method is deprecated:
loEmailObj = loMailman.FetchByMsgnum(lnMsgnum)
IF (loMailman.LastMethodSuccess = 0) THEN
? loMailman.LastErrorText
RELEASE loMailman
CANCEL
ENDIF
* ...
* ...
RELEASE loEmailObj
* ------------------------------------------------------------------------
* Do the equivalent using FetchOne.
* Your application creates a new, empty Email object which is passed
* in the last argument and filled upon success.
lnHeaderOnly = 0
* Irrelevant because we are not downloading headers-only.
lnNumBodyLines = 0
loEmailOut = CreateObject('Chilkat.Email')
lnSuccess = loMailman.FetchOne(lnHeaderOnly,lnNumBodyLines,lnMsgnum,loEmailOut)
IF (lnSuccess = 0) THEN
? loMailman.LastErrorText
RELEASE loMailman
RELEASE loEmailOut
CANCEL
ENDIF
RELEASE loMailman
RELEASE loEmailOut