1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 15:00:38 +00:00
QB64-PE/internal/help/_INFLATE$__1111111$.txt
Roland Heyder aeb9c0668b Updates help files for use with new Wiki parser (2nd try)
Note: Many files were removed (not yet existing/empty pages). The parser will try to download them on demand and will auto-generate text for missing pages (eg. most _gl pages).
2022-05-21 00:18:31 +02:00

52 lines
1.7 KiB
Plaintext

{{QBDLDATE:05-20-2022}}
{{QBDLTIME:23:08:43}}
{{DISPLAYTITLE:_INFLATE$}}
The [[_INFLATE$]] function decompresses a [[STRING|string]] compressed by the [[_DEFLATE$]] function.
{{PageSyntax}}
:{{Parameter|result$}} = [[_INFLATE$]]({{Parameter|stringToDecompress$[, originalSize&]}})
{{PageDescription}}
* {{Parameter|result$}} will contain the original version of {{Parameter|stringToDecompress$}}.
* Optional parameter {{Parameter|originalSize&}} can be used if the original size of the uncompressed data is known beforehand, which makes the decompression routine run more efficiently.
** If unspecified, decompression still works as expected, but may use more steps and need to allocate more memory internally.
==Availability==
* '''Version 1.4 and up'''.
{{PageExamples}}
''Example 1:'' Compressing a long string of text.
{{CodeStart}}
a$ = "The quick brown fox jumps over the lazy dog. "
{{Cl|PRINT}} "Original string (a$): "; a$
{{Cl|FOR}} i = 1 {{Cl|TO}} 15
a$ = a$ + a$
{{Cl|NEXT}}
{{Cl|PRINT}} "After concatenating it into itself several times, LEN(a$) ="; {{Cl|LEN}}(a$)
b$ = {{Cl|_DEFLATE$}}(a$)
{{Cl|PRINT}} "After using _DEFLATE$ to compress it, LEN ="; {{Cl|LEN}}(b$)
{{Cl|PRINT}} {{Cl|USING}} "(compressed size is #.###% of the original)"; (({{Cl|LEN}}(b$) * 100) / {{Cl|LEN}}(a$))
c$ = {{Cl|_INFLATE$}}(b$)
PRINT "After using _INFLATE$ to decompress it, LEN ="; {{Cl|LEN}}(c$)
{{CodeEnd}}
{{OutputStart}}
Original string (a$): The quick brown fox jumps over the lazy dog
After concatenating it into itself several times, LEN(a$) = 1474560
After using _DEFLATE$ to compress it, LEN = 4335
(compressed size is 0.295% of the original)
After using _INFLATE$ to decompress it, LEN = 1474560
{{OutputEnd}}
{{PageSeeAlso}}
* [[_DEFLATE$]]
{{PageNavigation}}