Sample code for 30+ languages & platforms
PowerBuilder

Transition from Zip.FirstMatchingEntry to Zip.EntryMatching

Provides instructions for replacing deprecated FirstMatchingEntry method calls with EntryMatching.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Zip
string ls_Pattern
oleobject loo_EntryObj
oleobject loo_Ze

li_Success = 0

loo_Zip = create oleobject
li_rc = loo_Zip.ConnectToNewObject("Chilkat.Zip")
if li_rc < 0 then
    destroy loo_Zip
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// ...
// ...
ls_Pattern = "*.txt"

// ------------------------------------------------------------------------
// The FirstMatchingEntry method is deprecated:

loo_EntryObj = loo_Zip.FirstMatchingEntry(ls_Pattern)
if loo_Zip.LastMethodSuccess = 0 then
    Write-Debug loo_Zip.LastErrorText
    destroy loo_Zip
    return
end if

// ...
// ...

destroy loo_EntryObj

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

loo_Ze = create oleobject
li_rc = loo_Ze.ConnectToNewObject("Chilkat.ZipEntry")

li_Success = loo_Zip.EntryMatching(ls_Pattern,loo_Ze)
if li_Success = 0 then
    Write-Debug loo_Zip.LastErrorText
    destroy loo_Zip
    destroy loo_Ze
    return
end if



destroy loo_Zip
destroy loo_Ze