Sample code for 30+ languages & platforms
PowerBuilder

.Z File Compression

See more Zip Examples

Use LZW compression to create a .Z compressed file. Compresses any single file into a .Z format compressed file.

(Chilkat's .Z compression functionality is included as part of the Chilkat Zip license.)

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Uc

li_Success = 0

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

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

li_Success = loo_Uc.CompressFile("hamlet.xml","hamlet.xml.Z")
if li_Success <> 1 then
    Write-Debug loo_Uc.LastErrorText
else
    Write-Debug "Success."
end if



destroy loo_Uc