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