Sample code for 30+ languages & platforms
Tcl Requires Chilkat v11.0.0+

Transition from Imap.FetchSequenceAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchSequenceAsMime method calls with FetchSingleBd.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set imap [new_CkImap]

#  ...
#  ...

set startSeqNum 1
set count 5

#  ------------------------------------------------------------------------
#  The FetchSequenceAsMime method is deprecated:

# sa is a CkStringArray
set sa [CkImap_FetchSequenceAsMime $imap $startSeqNum $count]
if {[CkImap_get_LastMethodSuccess $imap] == 0} then {
    puts [CkImap_lastErrorText $imap]
    delete_CkImap $imap
    exit
}

#  ...
#  ...

delete_CkStringArray $sa

#  ------------------------------------------------------------------------
#  Do the equivalent using FetchSingleBd.

CkImap_put_AutoDownloadAttachments $imap 1

set success 0
set bdMime [new_CkBinData]

set bUid 0
set i 0
while {$i < $count} {
    set success [CkImap_FetchSingleBd $imap [expr $startSeqNum + $i] $bUid $bdMime]
    #  ...
    #  ...

    set i [expr $i + 1]
}

delete_CkImap $imap
delete_CkBinData $bdMime