AutoIt
AutoIt
Transition from Zip.AppendBd to Zip.AddBd
Provides instructions for replacing deprecated AppendBd method calls with AddBd.Chilkat AutoIt Downloads
Local $bSuccess = False
$oZip = ObjCreate("Chilkat.Zip")
; ...
; ...
Local $sPathInZip = "example.dat"
$oBd = ObjCreate("Chilkat.BinData")
$oBd.LoadFile("c:/someDir/example.dat")
; ------------------------------------------------------------------------
; The AppendBd method is deprecated:
; AppendBd returns the zip entry object, which is usually not needed.
Local $oEntryObj = $oZip.AppendBd($sPathInZip,$oBd)
If ($oZip.LastMethodSuccess = False) Then
ConsoleWrite($oZip.LastErrorText & @CRLF)
Exit
EndIf
; ...
; ...
; ------------------------------------------------------------------------
; Do the equivalent using AddBd.
; Instead of returning the zip entry object, we just return success/failure.
$bSuccess = $oZip.AddBd($sPathInZip,$oBd)
If ($bSuccess = False) Then
ConsoleWrite($oZip.LastErrorText & @CRLF)
Exit
EndIf
; Do the following if you need the zip entry object for what was just appended.
; The newly appended entry is the last one.
$oZe = ObjCreate("Chilkat.ZipEntry")
Local $index = $oZip.NumEntries - 1
$oZip.EntryAt($index,$oZe)