
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GT_LIB v1.0 Reference Guide Release 1.0 - <b>compress a string or screen image with rle.</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Compress a string or screen image with RLE.
------------------------------------------------------------------------------
Syntax
GT_RleComp(<cString>,[<lIsAScreen>]) --> cCompressed
Arguments:
<cString> is the string to be compressed.
<lIsAScreen> is an optional logical paramepet to tell the
function that the string is a screen image. The default value
is TRUE.
Returns:
A Compressed version of the string or screen image.
Description:
GT_RleComp() uses a form of run length encoding to compress a
string, This form of compression is only any good on strings
that have a lot of repeating characters.
By default GT_RleComp() is optimized to compress screen images
as returned by Clipper's SaveScreen() function. When compressing
``normal'' strings this optimisation will not work so you must
tell the function to use the ``normal'' compression method.
Examples:
// Save the screen and compress it.
cScreen := GT_RleComp(savescreen())
...
restscreen(0,0,maxrow(),maxcol(),GT_RleUnCo(cScreen))
// Compress a normal string and print it's length.
cString := space(1000)
? len(GT_RleComp(cString,.F.))
Source: RLE.C
Author: Dave Pearson
See Also: GT_RLEUNCO()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson