PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Error codes
  • Compression level and addition time
  • Notes
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Changes the compression level used when creating an archive in ZIP format or in 7z format.
Versions 18 and later
Windows This function now supports the 7z format.
New in version 18
Windows This function now supports the 7z format.
Windows This function now supports the 7z format.
Example
NumZipErr is int
 
// Create the archive named "MyArchive"
NumZipErr = zipCreate("MyArchive", "C:\MyDocuments\Archive.zip")
IF NumZipErr <> 0 THEN
Error(zipMsgError(NumZipErr))
RETURN
END
 
// Add a file and use the default compression level (6)
NumZipErr = zipAddFile("MyArchive", "C:\MyImages\Image1.jpg", zipNone)
IF NumZipErr <> 0 THEN
Error(zipMsgError(NumZipErr) + "On the file " + zipCurrentFile("MyArchive"))
END
 
// Change the compression level
// The next file will be stored (no compression)
zipCompressionLevel("MyArchive", 0)
 
// Add a file
NumZipErr = zipAddFile("MyArchive", "C:\MyImages\Image2.jpg", zipNone)
IF NumZipErr <> 0 THEN
Error(zipMsgError(NumZipErr) + "On the file " + zipCurrentFile("MyArchive"))
END
 
Reports and Queries
NumZipErr is int
MyArchive is zipArchive
 
// Create the archive named "MyArchive"
NumZipErr = zipCreate(MyArchive, "C:\MyDocuments\Archive.zip")
IF NumZipErr <> 0 THEN
Error(zipMsgError(NumZipErr))
RETURN
END
 
// Add a file and use the default compression level (6)
NumZipErr = zipAddFile(MyArchive, "C:\MyImages\Image1.jpg", zipNone)
IF NumZipErr <> 0 THEN
Error(zipMsgError(NumZipErr) + "On the file " + zipCurrentFile(MyArchive))
END
 
// Change the compression level
// The next file will be stored (no compression)
zipCompressionLevel(MyArchive, 0)
 
// Add a file
NumZipErr = zipAddFile(MyArchive, "C:\MyImages\Image2.jpg", zipNone)
IF NumZipErr <> 0 THEN
Error(zipMsgError(NumZipErr) + "On the file " + zipCurrentFile(MyArchive))
END
 
Syntax
<Result> = zipCompressionLevel(<Archive> , <Compression level>)
<Result>: Integer
  • 0 if the compression level was changed,
  • An error code (value greater than 0) otherwise (see the Notes).
<Archive>: Character string (with quotes) or zipArchive variable
Name of archive to use.
This name can correspond to:
<Compression level>: Integer
Value included between 0 (storage without compression) and 9 (maximum compression).
The default compression level is set to 6.
Remarks

Error codes

The following error codes are returned:
  • 15: Archive in CAB format.
  • 27: Archive in WDZ format.
  • 28: Invalid compression level.
The message corresponding to the error code is returned by zipMsgError.

Compression level and addition time

Caution: A high compression level means that adding a file into the archive will take longer.

Notes

The compression level is defined by the call to the function for all the files that will be added to the archive thereafter (the compression level for the files already found in the archive remains the same).
Caution: Unable to change the compression level of a file found in an existing archive.
Component : wd250zip.dll
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment