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

Transition from ZipEntry.NextEntry to ZipEntry.GetNext

Provides instructions for replacing deprecated NextEntry method calls with GetNext.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oZip
LOCAL oEntry
LOCAL nFinished
LOCAL oNext
LOCAL oZe
LOCAL nEntryValid

nSuccess := 0

//  ------------------------------------------------------------------------
//  The NextEntry method is deprecated.
//  See below or code showing how to rewrite using EntryAt/GetNext

oZip := CreateObject("Chilkat.Zip")

nSuccess := oZip:OpenZip("qa_data/zips/xml_files.zip")
IF (nSuccess != 1)
    ? oZip:LastErrorText
    oZip:destroy()
    RETURN
ENDIF

oEntry := oZip:FirstEntry()
IF (oZip:LastMethodSuccess == 0)
    ? "This zip archive is empty."
    oZip:destroy()
    RETURN
ENDIF

nFinished := 0
DO WHILE nFinished == 0

    IF (oEntry:IsDirectory == 0)
        ? oEntry:FileName
    ELSE
        ? "(directory) " + oEntry:FileName
    ENDIF

    oNext := oEntry:NextEntry()
    IF (oEntry:LastMethodSuccess == 0)
        nFinished := 1
    ENDIF

    oEntry:destroy()
    oEntry := oNext
ENDDO

oZip:CloseZip()

? "----"

//  ------------------------------------------------------------------------
//  Do the equivalent using EntryAt/GetNext.

nSuccess := oZip:OpenZip("qa_data/zips/xml_files.zip")

oZe := CreateObject("Chilkat.ZipEntry")
oZip:EntryAt(0, oZe)

nEntryValid := 1
DO WHILE nEntryValid == 1

    IF (oZe:IsDirectory == 0)
        ? oZe:FileName
    ELSE
        ? "(directory) " + oZe:FileName
    ENDIF

    nEntryValid := oZe:GetNext()
ENDDO

oZip:CloseZip()

oZip:destroy()
oZe:destroy()