AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos
  • Stopping the file compression
fStopCompress (Example)
Stopping the file compression
WINDEVReportes y ConsultasWindowsCódigo de Usuario (UMC) The following code is used to stop the file compression at a given time. The file to compress and the compressed file are selected by fSelect. A progress indicates the compression percentage. This progress bar will be displayed in the status bar.
// -- Click code on BTN_CompressFile
// Initialization code
EventNum is int
FileToCompress is string
CompressedFile is string
ResCompression is int
 
// Select the file to compress
FileToCompress = fSelect("", "", "Select the file to compress", ...
"All files (*.*) "+ TAB + "*.*", "", fselOpen+fselExist)
 
// Select the compressed file
CompressedFile = fSelect("", "", "Select the compressed file", ...
"All files (*.*)" + TAB + "*.*", "", fselCreate)
// Call the event to display the progress bar
EventNum = Event("Dis_Compress_ProgressBar", WinInput(), compressProgressBar)
// Compress the file
ResCompression = fCompress(FileToCompress, CompressedFile)
// End of event
EndEvent(EventNum)
 
// Display an error message if the compression failed
IF ResCompression <> 0 THEN
Error(ErrorInfo(errMessage))
ELSE
Info("The compression was performed")
END
// Local procedure Dis_Compress_ProgressBar
PROCEDURE Dis_Compress_ProgressBar(wMessage, wParam, lParam)
IF wParam < 100 THEN
ProgressBar(wParam, 100)
 
// Refresh the window
Multitask(-1)
ELSE
// The compression is over
ProgressBar()
END
// -- Click code on BTN_StopCompression
IF YesNo("Do you want to stop the current compression?") THEN
fStopCompress()
END
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/08/2022

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