ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Decompressing a file (WINDEV)
  • Decompressing a file (WEBDEV)
fUncompress (Example)
Decompressing a file (WINDEV)
Reports and Queries The following code is used to decompress a file. The file to decompress and the decompressed file are selected by fSelect. A progress bar is used to indicate the percentage of decompression. This progress bar will be displayed in the status bar.
// -- Click code on BTN_DecompressFile
// Initialization code
EventNum is int
FileToDecompress is string
DecompressedFile is string
ResDecompression is int
 
// Select the file to decompress
FileToDecompress = fSelect("", "", "Select the file to decompress",...
"All files (*.*)" + TAB + "*.*", "", fselOpen + fselExist)
 
// Select the decompressed file
DecompressedFile = fSelect("", "", "Select the decompressed file",...
"All files (*.*)" + TAB + "*.*", "", fselCreate)
 
// Call the event to display the progress bar
EventNum = Event("ProgBarDecompress", WinInput(), CompressProgressBar)
 
// Decompress the file
ResDecompression = fUncompress(FileToDecompress, DecompressedFile)
 
// End of event
EndEvent(EventNum)
 
// Display the error message if the decompression failed
IF ResDecompression <> 0 THEN
  Error(ErrorInfo(errMessage))
ELSE
  Info("The file was decompressed")
END
// Local ProgBarDecompress procedure
PROCEDURE ProgBarDecompress(wMessage, wParam, lParam)
IF wParam < 100 THEN
  ProgressBar(wParam, 100)
  // Refresh the window
  Multitask(-1)
ELSE
  // The decompression is done
  ProgressBar()
END
Decompressing a file (WEBDEV)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/22/2022

Send a report | Local help