PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Decompressing a file (WINDEV)
  • Decompressing a file (WEBDEV)
fUncompress (Example)
Decompressing a file (WINDEV)
WINDEVReports and QueriesUser code (UMC) 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)
WEBDEV - Server codeAjax The following code is used to decompress a file.
// -- 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 = "C:\MyDirectories\CompressedFile.tx_"
// Select the decompressed file
DecompressedFile = "C:\MyDirectories\File.txt"

// Decompress the file
ResDecompression = fUncompress(FileToDecompress, DecompressedFile)
// Display the error message if the decompression failed
IF ResDecompression <> 0 THEN
Error(ErrorInfo(errMessage))
ELSE
Info("The file was decompressed")
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment