PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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 Java applications.
New in version 15
Java This function is now available for Java applications.
Java This function is now available for Java applications.
Versions 18 and later
WINDEVWindows This function now supports the 7z format.
New in version 18
WINDEVWindows This function now supports the 7z format.
WINDEVWindows This function now supports the 7z format.
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
WINDEV
NumErrZip is int
MonArchive is zipArchive
 
// Création de l'archive "MonArchive"
NumErrZip = zipCreate(MonArchive, "C:\MesDocuments\Archive.zip")
IF NumErrZip <> 0 THEN
Error(zipMsgError(NumErrZip))
RETURN
END
 
// Ajout d'un fichier au taux de compression par défaut (6)
NumErrZip = zipAddFile(MonArchive, "C:\MesImages\Image1.jpg", zipNone)
IF NumErrZip <> 0 THEN
Error(zipMsgError(NumErrZip) + "Sur le fichier " + zipCurrentFile(MonArchive))
END
 
// Changement du taux de compression
// Le prochain fichier sera simplement stocké (aucune compression)
zipCompressionLevel(MonArchive, 0)
 
// Ajout d'un fichier
NumErrZip = zipAddFile(MonArchive, "C:\MesImages\Image2.jpg", zipNone)
IF NumErrZip <> 0 THEN
Error(zipMsgError(NumErrZip) + "Sur le fichier " + zipCurrentFile(MonArchive))
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 or zipArchive variable
Name of archive to use.
This name can correspond to:
  • or to the name of an archive defined with function zipOpen or function zipCreate.
  • Versions 15 and later
    WINDEV the name of a variable of type zipArchive.
    New in version 15
    WINDEV the name of a variable of type zipArchive.
    WINDEV the name of a variable of type zipArchive.
<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.
Business / UI classification: Business Logic
Component: wd270zip.dll
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment