Sample code for 30+ languages & platforms
AutoIt

Transition from Imap.FetchChunk to Imap.FetchRange

Provides instructions for replacing deprecated FetchChunk method calls with FetchRange.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

$oImap = ObjCreate("Chilkat.Imap")

; ...
; ...

Local $iStartSeqNum = 1
Local $iCount = 5

$oFailedSet = ObjCreate("Chilkat.MessageSet")
$oFetchedSet = ObjCreate("Chilkat.MessageSet")

; ------------------------------------------------------------------------
; The FetchChunk method is deprecated:

Local $oBundleObj = $oImap.FetchChunk($iStartSeqNum,$iCount,$oFailedSet,$oFetchedSet)
If ($oImap.LastMethodSuccess = False) Then
    ConsoleWrite($oImap.LastErrorText & @CRLF)
    Exit
EndIf

; ...
; ...

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

Local $bHeadersOnly = False

$oBundleOut = ObjCreate("Chilkat.EmailBundle")
$bSuccess = $oImap.FetchRange($bHeadersOnly,$iStartSeqNum,$iCount,$oBundleOut)
If ($bSuccess = False) Then
    ConsoleWrite($oImap.LastErrorText & @CRLF)
    Exit
EndIf