PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Returns the list of files found in an archive
zipListFile (Example)
Returns the list of files found in an archive
The following code is used to display the list of files found in an archive in a memory table (TABLE_FileTable).
// Declare and initialize the variables
ArchiveName is string = "MyArchive"
DirectoryName is string
AListOfFiles is string
ErrorCodeCreation is int
ErrorCodeAddition is int
 
// Create an archive
ErrorCodeCreation = zipCreate(ArchiveName, "C:\Directory\Archives\ArchivePdf.zip")
 
// Create an archive (WINDEV Mobile)
// ErrorCodeCreation = zipCreate(ArchiveName, "\Directory\Archives\PdfArchive.wdz")
 
IF ErrorCodeCreation = 0 THEN
// Select the directory
DirectoryName = fSelectDir("", "", "Directory to add")
// Add all the files found in the selected directory
// and in its subdirectories into the archive
ErrorCodeAddition = zipAddDirectory(ArchiveName, DirectoryName, True, zipDirectory)
IF ErrorCodeAddition = 0 THEN
// Return the list of files found in the archive
AListOfFiles = zipListFile(ArchiveName)
// Display the list of files in a memory table
  TableAdd(TABLE_FileTable, AListOfFiles)
ELSE
// Display an error message if the files have not been added
  Error(zipMsgError(ErrorCodeAddition))
END
ELSE
// Display an error message if the archive was not created
Error(zipMsgError(ErrorCodeCreation))
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment