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 zipAddFile
WLanguage procedure ("Callback") used by zipAddFile to manage the progress of files being added to the archive.
If you use a TAR or TGZ (TAR.GZ) archive, the progress is refreshed only after the file is added.
Example
// -- Initialization code of window
GLOBAL
ArchiveName is string = "MyArchive"
 
// -- Click code on BTN_AddFile
// Initialization code
FileName is string
CreationErrorCode is int
AdditionErrorCode is int
EventNum 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 file to add
FileName = fSelect("", "", "File to add", ...
   "File to compress" + TAB + "*.*", "*", fselOpen + fselExist)
// Add the selected file to the archive
AdditionErrorCode = zipAddFile(ArchiveName, FileName, zipNone, Compression_ProgressBar)
// Display an error message if the file was not added
IF AdditionErrorCode <> 0 THEN
Error(zipMsgError(AdditionErrorCode))
END
ELSE
Error(zipMsgError(CreationErrorCode))
END
 
 
// Internal procedure used for the progress bar.
INTERNAL PROCEDURE Compression_ProgressBar(CurrentFile is string, Percentage is int)
IF Percentage < 100 THEN
ProgressBar(Percentage, 100, CurrentFile)
// Refresh the window
Multitask(-1)
ELSE
// The compression is over
ProgressBar()
END
END
Syntax
zipAddFile_Callback(<Current file> , <Progress percentage>)
<Current file>: Character string
Name of the file being processed.
<Progress percentage>: Integer
Progress percentage of the file being added to the archive.
Component: wd290zip.dll
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