You don't have to uncompress the whole thing to search for one word... You could arrange it into several records that contained the compressed content - say record one is all a-words compressed, record two is all b-words compressed, and so on. That way when you need to look up a word, you only uncompress the section you need. Might be a bit slower, but you won't take up 500k....
Kevin -----Original Message----- From: Robert Purcell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 10:25 AM To: Palm Developer Forum Subject: Re: Word Lists for Games My database contains records of compressed data. So, the data in the records is useless until I decompress it. So, I decompress the data into memory. When I originally started writing this game, I thought I would simply use a database, but do you have any idea how large a database with 40,000 records is? It's HUGE!! And I really didn't want my game to be 500kb...that's a bit large for a palm game. So, I knew that I would have to use some sort of compression on my word list. After I compressed the list, the problem was how do I store this list in my PRC. The code segment is limited to 64kb, so I knew that I couldn't store my list in the PRC. So I ended up storing my COMPRESSED list as a resource attached to the PRC file, then at run-time I extract the resource as a database (containing the compressed list), and I decompress it to memory. Bottom-line, a database of 40,000 records is way too LARGE for a Palm game. And compressed data in records is useless until it's uncompressed. Thanks for your help! -Robert > My main issue is how to store and retrieve the word > list from memory without having to create a huge > amount of heap space to store the decompressed > dictionary. why do you need to store it in memory? why not just leave the words in the database and do your lookups in the database instead of in memory? if you have everything in the database in sorted order you should be able to get far more than 40,000 words. Matt __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ ------------------------------------------ The information in this transmittal and any attachments is privileged and confidential and is intended only for the recipient(s) listed above. You are hereby notified that any unauthorized distribution or copying of this transmittal or its attachments is prohibited. If you have received this transmittal in error, please notify Invivodata immediately at (831) 438-9550. ------------------------------------------ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
