Perform LZW compression on the given source data and return the packed data on success. The source can be any sequence of bytes inclusive zeros and control chars.
SYNTAX:
packed$ = LzwPack$ (SourceData$, MinRatio%)
INPUTS:
SourceData$ (STRING)
- The data you want to compress. Note that very small data sizes may not compress very well and may cause this function to fail.
MinRatio% (INTEGER)
- Your desired minimum compression ratio, ie. how many percent the source data should be reduced at least, to consider it a successful run. Can be set to zero, then just one byte less than the source's size is considered a success. However, regular values should be 5-50%.
RESULT:
packed$ (STRING)
- The LZW compressed data on success or an empty string, if packing did not reach your desired minimum ratio.