Author | Topic: Tools CharPack() & CharUnPack() functions | |
---|---|---|
Jim Graham | Tools CharPack() & CharUnPack() functions on Thu, 11 Sep 2008 10:06:00 -0400 X:= CharPack("The quick brown fox jumped over the lazy dog." ) "Packed string: " , x ---------------------> "The quick brown fox jumped over the lazy dog." "Unpacked string: " ,CharUnPack(x) ---------------------> "The quick brown fox jumped over the lazy dog." Both functions return the same string? Ie. The Charpack function does not pack the string? Am I not using the function (s) correctly? Jim Graham Vice President Professional Teledata 175 Canal Street Manchester, NH 03101 800.344.9944 www.proteledata.com | |
Donald R. Keating | Re: Tools CharPack() & CharUnPack() functions on Thu, 11 Sep 2008 20:20:59 -0400 Hi Jim, Don't remember seeing CharPack() before and would assume it is supposed to remove at least the spaces from the string being packed. Won't hazard a guess as to what CharUnPack() is supposed to do. I've always used CharRem() and it works as advertised. Ain't computers fun?! >don< On Thu, 11 Sep 2008 10:06:00 -0400, Jim Graham wrote: > X:= CharPack("The quick brown fox jumped over the lazy dog." ) > "Packed string: " , x ---------------------> "The quick brown fox jumped > over the lazy dog." > "Unpacked string: " ,CharUnPack(x) ---------------------> "The quick brown > fox jumped over the lazy dog." > > Both functions return the same string? Ie. The Charpack function does not > pack the string? > > Am I not using the function (s) correctly? | |
Rodd Graham | Re: Tools CharPack() & CharUnPack() functions on Fri, 12 Sep 2008 03:02:53 +0000 Hello Jim, > X:= CharPack("The quick brown fox jumped over the lazy dog." ) > "Packed string: " , x ---------------------> "The quick brown fox > jumped > over the lazy dog." > "Unpacked string: " ,CharUnPack(x) ---------------------> "The quick > brown > fox jumped over the lazy dog." > Both functions return the same string? Ie. The Charpack function does > not pack the string? > > Am I not using the function (s) correctly? What is your goal? Your sample string does not lend itself to run-length encoding since it does not have any character runs. You will see CharPack() do something if you submit a string like "aaaaabbbbbbbcccccc" which has character runs. It is difficult to get compression out of short data sequences due to the need for redundancy and the overhead of representing compression metadata. Regards, Rodd Graham, Consultant Graham Automation Systems, LLC |