ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Stopping the file compression
fStopCompress (Example)
Stopping the file compression
WINDEVReports and QueriesWindowsUser code (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
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/22/2022

Send a report | Local help