Decompress the given LZW packed data back to its original data format. This function will check the internally encoded signature to make sure the given data is really packed and originated by LzwPack$(). After decompression it will also check the unpacked data against its original checksum (CRC32) to recognize eventual data corruption.
SYNTAX:
unpacked$ = LzwUnpack$ (LzwData$)
INPUTS:
LzwData$ (STRING)
- The LZW compressed data you want to decompress, usually the result of a former call to the LzwPack$() function.
Hidden feature inputs:
- There is a hidden feature in this library. In your main module you may define "DIM SHARED lzwProgress$" (STRING) and put the handle of any ProgressC class object defined in your GUI into that variable before actually calling LzwUnpack$(). In that case the ProgressC object is updated while unpacking the data. If lzwProgress$ is left empty or not even DIM SHARED, then unpacking is done quietly. Note that lzwProgress$ is automatically cleared out after unpacking is finished to avoid accidentally reusing a maybe not longer valid object, hence you must newly provide the ProgressC object for each call. I use this unusual input way here, to keep the parameter list for the LzwUnpack$() call compatible to that one provided in my lzwpacker.bm library or expressed different, this feature is a GuiTools based addition, which shall not interfere with lzwpacker.bm.
RESULT:
unpacked$ (STRING)
- The original (uncompressed) data or an empty string, if any of the above mentioned checks will fail.