Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>sx_compress():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Sx_Compress():

  Syntax:   Sx_Compress( <cString> )

            cString = String of data to be compressed.

  Returns:  A string containing the data compressed from cString.  If the
            value passed to Sx_Compress() is not a character string, that
            same value (unchanged) is returned.

  Description:  Sx_Compress() and its related function Sx_Decompress()
                provide an easy way to create and restore compressed
                data.  Any valid string data can be handled by these
                functions.  Memory requirements are very minimal.  Only
                9k plus the size of the string is required to compress
                and decompress the data.

                The compression method utilized is a modified LZSS
                algorithm.  This algorithm provides for a good balance
                of speed and compression.

                This function is the compression engine that is used in
                Sx_File2BLOB() and Sx_BLOB2File().

  Example:

    // Routine to compress memo field contents (text) in entire .FPT

    USE test VIA "SIXCDX"   // Open TEST.DBF and TEST.FPT
    dbGoTop()               // Make sure we're at the top

    WHILE !eof()
      test->NOTES := Sx_Compress( test->NOTES )  // Compress NOTES field
      dbSkip()                                   // Go to next record
    ENDDO

    Sx_MemoPack()  // Pack .FPT file to purge all of the newly freed blocks


See Also: Sx_Decompress() Sx_FCompress() Sx_FDecompress()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson