Sample code for 30+ languages & platforms
AutoIt

Transition from Imap.Sort to Imap.QueryMbx

Provides instructions for replacing deprecated Sort method calls with QueryMbx.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

$oImap = ObjCreate("Chilkat.Imap")

; ...
; ...

Local $searchCriteria = "FROM bob@example.com"
Local $bUid = True
Local $sortCriteria = "DATE SUBJECT"

; ------------------------------------------------------------------------
; The Sort method is deprecated:

Local $oMsgSetObj = $oImap.Sort($sortCriteria,"UTF-8",$searchCriteria,$bUid)
If ($oImap.LastMethodSuccess = False) Then
    ConsoleWrite($oImap.LastErrorText & @CRLF)
    Exit
EndIf

; ...
; ...

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

; The following properties are used instead of function arguments.
$oImap.SortCriteria = "DATE SUBJECT"
$oImap.SearchCharset = "UTF-8"

$oMset = ObjCreate("Chilkat.MessageSet")
$bSuccess = $oImap.QueryMbx($searchCriteria,$bUid,$oMset)
If ($bSuccess = False) Then
    ConsoleWrite($oImap.LastErrorText & @CRLF)
    Exit
EndIf