PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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 15 and later
Java This function is now available for the Java applications.
Android This function is now available for the Android applications.
New in version 15
Java This function is now available for the Java applications.
Android This function is now available for the Android applications.
Java This function is now available for the Java applications.
Android This function is now available for the Android applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
WINDEVWEBDEV - Server codeWindows This function now supports the 7z format.
New in version 18
Android Widget This function is now available in Android Widget mode.
WINDEVWEBDEV - Server codeWindows This function now supports the 7z format.
Android Widget This function is now available in Android Widget mode.
WINDEVWEBDEV - Server codeWindows This function now supports the 7z format.
Versions 19 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 19
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
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
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230zip.dll
Windows Mobile wp230zip.dll
Java wd230java.jar
Linux wd230zip.so
Android wd230android.jar
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment