ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Archive functions / WLanguage procedure
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
WLanguage procedure called by zipAddDirectory
WLanguage procedure ("Callback") called when adding files with zipAddDirectory. This procedure allows you to archive a tree structure by excluding one or more files.
Example
// Declare and initialize the variables
DirectoryName is string
ArchiveName is string = "MyArchive"
CreationErrorCode is int
AdditionErrorCode is int
 
// Create an archive
CreationErrorCode = zipCreate(ArchiveName, "C:\MyDirectory\MyArchives\PdfArchive.wdz")
 
// Display an error message if the archive was not created
IF CreationErrorCode = 0 THEN
// Select the directory
DirectoryName = fSelectDir("", "", "Directory to add")
 
// Adds "BMP" files from the selected directory
// and subdirectories to the archive
AdditionErrorCode = zipAddDirectory(ArchiveName, DirectoryName, True, ...
 zipDrive, zipAddDirectory_Callback)
 
// Display an error message if the files have not been added
IF AdditionErrorCode <> 0 THEN
 Error(zipMsgError(AdditionErrorCode))
END
ELSE
Error(zipMsgError(CreationErrorCode))
END
 
INTERNAL PROCÉDURE zipAddDirectory_Callback(FileName is string)
IF fExtractPath(FileName, fExtension) ~= ".gif" THEN
RESULT True
ELSE
RESULT False
END
END
Syntax
<Result> = zipAddDirectory_Callback(<File name>)
<Result>: Boolean
  • If the procedure returns True, the file must be included in the archive.
  • If the procedure returns False, the file must not be included in the archive.
<File name>: Character string
Path of the file that will be processed by zipAddDirectory.
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help