Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: leafy on February 03, 2011, 01:26:44 am
-
What is the most efficient way to store text in Axe and then display it on the screen? I've noticed that when I use a direct text function it takes up a lot of memory.
-
What do you mean by the direct text function? The easiest way to store text is simply to "Text"->Str1. But I have a feeling that you already tried that and didn't like the memory rates you were getting?
-
Yeah, was wondermg if there was any way to compress text.
-
You could always try huffman compression, but thats pretty complex. How much text do you have?
-
If you don't use any special characters, you could cut off the high bit of each letter, that would reduce the size 12.5%. If its all upper-case, you can do a direct mapping with only 6 bits which could compress it by 25%. Otherwise, huffman is really good at text compression (You might be able to get up to 50% compression) but the algorithm is so long and complicated that it might only be worth it if you had over 5k of text. Another suggestion is to use a special character that you never use as a "word replacer" for common words. Lets say that character [FB] is never used, you could have the sequence [FB01] replace the word "the" and [FB02] replace the word "only" etc. They can even be inserted into the middle of a sentence: [FB02]"re" would become "there".