PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Finding the type of the archive
zipIsMulti (Example)
Finding the type of the archive
Reports and QueriesUser code (UMC)Ajax
The following code is used to find out the type of an archive: single-part or multi-part archive.
// Declare and initialize the variables
ErrorCodeCreation is int
ErrorCodeAddition is int
ErrorCodeSplit is int
NbNecessaryParts is int
ResIsMulti is boolean
 
// Create an archive
ErrorCodeCreation = zipCreate("MyArchive", "C:\MyArchives\MyArchive.WDZ")
 
IF ErrorCodeCreation = 0 THEN
// Add files into this archive
ErrorCodeAddition = zipAddDirectory("MyArchive", ...
"C:\MyDir\MyFiles", True, zipDirectory)
 
IF ErrorCodeAddition = 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(ErrorCodeAddition))
END
ELSE
// Display an error message if the files have not been added
Error(zipMsgError(ErrorCodeCreation))
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