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

Transition from Imap.ThreadCmd to Imap.QueryThread

Provides instructions for replacing deprecated ThreadCmd method calls with QueryThread.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set imap [new_CkImap]

#  ...
#  ...

set threadAlg "REFERENCES"
set charset "UTF-8"
set searchCriteria "SUBJECT a"
set bUid 1

#  ------------------------------------------------------------------------
#  The ThreadCmd method is deprecated:

# jsonObj is a CkJsonObject
set jsonObj [CkImap_ThreadCmd $imap $threadAlg $charset $searchCriteria $bUid]
if {[CkImap_get_LastMethodSuccess $imap] == 0} then {
    puts [CkImap_lastErrorText $imap]
    delete_CkImap $imap
    exit
}

#  ...
#  ...

delete_CkJsonObject $jsonObj

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

CkImap_put_SearchCharset $imap "UTF-8"

set json [new_CkJsonObject]

set success [CkImap_QueryThread $imap $threadAlg $searchCriteria $bUid $json]
if {$success == 0} then {
    puts [CkImap_lastErrorText $imap]
    delete_CkImap $imap
    delete_CkJsonObject $json
    exit
}


delete_CkImap $imap
delete_CkJsonObject $json