Xbasic

*Gzip_text Function

Syntax

B result *GZIP_TEXT(text as c[,nativeFormat as l])

Arguments

resultBinary

Compressed string, as blob

textCharacter

String to compress

nativeFormatLogical

Use native format.

Description

Compress string using gzip.

Discussion

Compresses a text variable. Result is a blob. The amount of compression will depend on the size of the input string. Compressing a small string might result in blob that is actually larger than the input string.

Example

dim bigtext as c
bigtext = replicate( "This is a test of the gzip library", 20 )
b = *GZIP_TEXT (bigtext )
? b.size() =
48 
? len( bigtext ) =
680 
bigtext2 = *gunzip_text (b )
? len ( bigtext2 ) = 680 
? bigtext = bigtext2
=.
T.

See Also