Kevin Miller wrote:

> On 29/6/00 8:23 am, Sjoerd Op 't Land <[EMAIL PROTECTED]> wrote:
> 
>> Hello all,
>> 
>> When I was making a stack working with compressed files, but I had trouble,
>> so I made a 'expiriment' stack with 3 fields:
>> field "u" -- plain text
>> field "c" -- contains compress(field "u")
>> field "n" -- contains the charToNums of all chars in field "u"
>> 
>> Example:
>> I put "fghjdfhgjghjd" in field "u", press a button, and get 18 char string
>> in field "c". But MetaCard says that is just contains 3 chars: charToNum
>> 31,139 and 8. OK, now I try to copy the compressed string to this e-mail:
>> � Weird, isn't it?
>> 
>> Why does this happen? Is one of these chars delete or something?
> 
> Compressed data is binary - so you can't display it in a field.  That
> explains the strange behaviour you have been seeing.  You need to convert it
> to text if you want to copy, display or save it as text.  To do that, use
> the base64encode function (then use base64decode and decompress to access
> the data again).  If you're using the Starter Kit,
I am ;-(
> you can also shorten this
> to just one line for compress/encode and one for decompress/decode like
> this:
> 
> put base64Encode(compress(the text of fld "whatever")) into tCompressedData
> put decompress(base64decode(tCompressedData))
Great! This works perfectly!
Thanks,
Sjoerd
> Regards,
> 
> Kevin
> 
>> Thanks for any suggestions in advance,
>> Sjoerd
> 
> Kevin Miller <[EMAIL PROTECTED]> <http://www.xworlds.com/>
> Cross Worlds Computing, MetaCard Distributors, Custom Development.
> Tel: +44 (0)131 672 2909.  Fax: +44 (0)1639 830 707.


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to