Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Error codes
  • Progress Bar
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Compresses a file. This file can be decompressed by fUncompress.
Remark: The small-size files are not likely to be compressed.
Reminder: Archiving functions (zipXXX functions) allow to manage archives in ZIP, CAB, 7z, etc.
// Compress a file
Res = fCompress("C:\Directories\File.txt", "C:\Directories\CompressedFile.txt")
<Result> = fCompress(<Path of file to compress> , <Path of compressed file>)
<Result>: Integer
  • 0 if the compression was performed,
  • an error code (value greater than 0) otherwise.
<Path of file to compress>: Character string
Name and full (or relative) path of the file to compress (up to 260 characters). A UNC path can be used.
<Path of compressed file>: Character string
Name and full (or relative) path of compressed file (up to 260 characters). A UNC path can be used.

Error codes

The following error codes are returned:
  • 1: The file to compress cannot be opened.
  • 2: Unable to create the compressed file. This error occurs if <Path of compressed file> does not exist.
  • 4: The file cannot be compressed: the file is copied (the size of the file to compress is too small for instance).
  • 5: Insufficient memory to perform the compression.
  • 6: The compression was canceled by the user: fStopCompress has been executed.
  • 7: Insufficient space to create the compressed file.
The error code message can be retrieved using the ErrorInfo function with the rrMessage constant.

Progress Bar

To view the progress of file compression, use Event to process the GaugeCompaction message (1174). When this message is received, the _EVE.wParam variable contains the percentage of file compression.
Component: wd290std.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 08/25/2022

Send a report | Local help