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 to handle the progress bar
WLanguage procedure ("Callback") used by zipAddDirectory to manage the progress of files being added to the archive.
Example
// -- Global declarations of the window
GLOBAL
ArchiveName is string = "MyArchive"
// -- Click on BTN_AddDirectory
// Initialize the variables
DirectoryName is string
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 all the files found in the selected directory into the archive
ErrorCodeAddition = zipAddDirectory(ArchiveName, DirectoryName, False, zipDirectory, ...
zipAddDirectoryProgressBar_Callback)
// Display an error message if the file was not added
IF AdditionErrorCode <> 0 THEN
Error(zipMsgError(AdditionErrorCode))
END
ELSE
Error(zipMsgError(CreationErrorCode))
END
// This procedure is used to manage the progress bar.
INTERNAL PROCÉDURE zipAddDirectoryProgressBar_Callback(CurrentFile is string,
OverallProgress is int, FileProgress is int)
IF OverallProgress < 100 THEN
ProgressBar(OverallProgress, 100, CurrentFile)
// Refresh the window
Multitask(-1)
 
ELSE
ProgressBar()
END
END
Syntax
zipAddDirectory_ProgressBarCallBack(<Current file> , <Overall progress percentage> , <File progress percentage>)
<Current file>: Character string
Name of the file being processed.
<Overall progress percentage>: Integer
Progress percentage of the files added to the archive.
<File progress percentage>: Integer
Progress percentage of the file being added to the archive.
Remarks
If you are using a 7z archive, only <Overall progress percentage> is specified. <File progress percentage> will have the same value.
Business / UI classification: Neutral code
Component: wd290java zip.dll
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