|
|
|
|
WLanguage Procedure llamado por zipAddFile WLanguage Procedure ("Callback") utilizado por zipAddFile para gestionar el progreso de los ficheros que se añaden al archivo. Si utiliza un archivo TAR o TGZ (TAR.GZ), el progreso se actualiza sólo después de añadir el archivo. // -- 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
Sintaxis
zipAddFile_Callback(<Current file> , <Progress percentage>)
<Current file>: Cadena de caracteres Nombre del archivo que se está procesando. <Progress percentage>: Integro Porcentaje de progreso del archivo que se está añadiendo al archivo.
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|