ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Archive functions
  • Finding the type of the archive
zipIsMulti (Example)
Finding the type of the archive
WINDEVUser code (UMC)
The following code is used to find out the type of an archive: single-part or multi-part archive.
// Declare and initialize the variables
CreationErrorCode is int
AdditionErrorCode is int
ErrorCodeSplit is int
NbNecessaryParts is int
ResIsMulti is boolean
 
// Create an archive
CreationErrorCode = zipCreate("MyArchive", "C:\MyArchives\MyArchive.WDZ")
 
IF CreationErrorCode = 0 THEN
// Add files into this archive
AdditionErrorCode = zipAddDirectory("MyArchive", ...
"C:\MyDir\MyFiles", True, zipDirectory)
 
IF AdditionErrorCode = 0 THEN
// Number of necessary diskettes
NbNecessaryParts = zipNbPartNeeded("MyArchive", ...
1400*1024)
Info(NbNecessaryParts + "diskettes are required")
// Split the archive
ErrorCodeSplit = zipSplit("MyArchive", ...
"A:\Archive.WDZ", 1400*1024, False, 100*1024)
// Display the error message
// if the archive was not split
IF ErrorCodeSplit <> 0 THEN
Error(zipMsgError(ErrorCodeSplit))
END
ELSE
// Display an error message if the archive was not created
Error(zipMsgError(AdditionErrorCode))
END
ELSE
// Display an error message if the files have not been added
Error(zipMsgError(CreationErrorCode))
END
 
// Single-part or multi-part archive?
ResIsMulti = zipIsMulti(ArchiveName)
 
// Display the result
IF ResIsMulti = True THEN
Info("The archive is a multi-part archive")
ELSE
Info("The archive is a single-part archive")
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help