AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos / Procedimiento WLanguage
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Procedimiento WLanguage llamado por la función zipAddFile
Procedimiento WLanguage ("Callback") utilizado por la función zipAddFile para seguir el progreso de los archivos que se añaden al archivo comprimido.
Si utiliza un archivo TAR, gzip o TGZ (TAR.GZ), el progreso se actualiza solo cuando se ha añadido el archivo.
Ejemplo
// -- 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>: Entero
Porcentaje de progreso del archivo que se está añadiendo al archivo comprimido.
Componente: wd300zip.dll
Ver también
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 22/05/2025

Señalar un error o enviar una sugerencia | Ayuda local