Xbase++ Requires Chilkat v11.0.0+
Xbase++
Transition from Zip.AppendNew to Zip.AddEmpty
Provides instructions for replacing deprecated AppendNew method calls with AddEmpty.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oZip
LOCAL cPathInZip
LOCAL oEntryObj
LOCAL nIsDir
LOCAL oZe
LOCAL nIndex
nSuccess := 0
oZip := CreateObject("Chilkat.Zip")
// ...
// ...
cPathInZip := "example.dat"
// ------------------------------------------------------------------------
// The AppendNew method is deprecated:
oEntryObj := oZip:AppendNew(cPathInZip)
IF (oZip:LastMethodSuccess == 0)
? oZip:LastErrorText
oZip:destroy()
RETURN
ENDIF
// ...
// ...
oEntryObj:destroy()
// ------------------------------------------------------------------------
// Do the equivalent using AddEmpty.
// Indicate the newly appended entry is not a directory entry.
nIsDir := 0
nSuccess := oZip:AddEmpty(nIsDir, cPathInZip)
IF (nSuccess == 0)
? oZip:LastErrorText
oZip:destroy()
RETURN
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 := CreateObject("Chilkat.ZipEntry")
nIndex := oZip:NumEntries - 1
oZip:EntryAt(nIndex, oZe)
oZip:destroy()
oZe:destroy()