I do this in all my C++ record classes derived from Christopher Hunt's
Teenee::AbstractDataMgr. Basically, my class has data members for each of
the fields in the record and I implement the pack()/unpack() methods to
load/unload a Palm DB record. I put all my fixed width fields at the
beginning of the record (i.e. UInt32, Boolean, etc.) and a '\0' separated
string list on the back end. My apps are mostly portable versions of
database forms and, as you suggest, the space saved is tremendous.
-- Paul
PS: if you come up with a quick compress scheme to do even better, please
let us know
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> [EMAIL PROTECTED]
> Sent: Tuesday, February 08, 2000 9:04 AM
> To: Palm Developer Forum
> Subject: Variable Length Recs and compression - Seeking for some advice
>
>
> Hello All,
>
> Due to a huge amount of data records I plan to download into a
> pilot DB I'm
> seeking for the best approach of storing my data efficiently (verry
> efficiently...)
>
> My records now do have many fields such like
> Char Descr [255]
> Char Msg [30]
> Char Name [55]
> and so on
>
> whereby I often use much less than the defined number of chars -
> so I know I
> waste a lot of space.
>
> I wonder if it is possible to change my record layout to actualy
> point to a
> string DB that holds variable length records containing these strings.
>
> Is this possible (varible lengths records).
>
> Anybody out there who can give some ideas or advices on the best
> approach on
> this problem ?
>
> I also think of compressing the individual strings with a little
> zip-routine
> (or any other compression algorithm) or something similar so that I only
> "unpack" the strings I actualy need. String-packing might reduce my record
> size by 50% or above - I think.
>
> I wonder if somebody out there has already done something similar
> and would
> like to share his/her ideas and source snippets.
>
> Any ideas, advices or pointers to further material that might help is
> greatly appreciated. The data I need in my pilot is > 24 MB ....
> and I want
> this in a 8MB Pilot Vx....
>
> I think it is possible if I
> a)
> can make variable lengths records (avarage amount of men = 50% of
> fixed Char
> fields) so I'm down to 12 MB
> b)
> Compression with a ratio 50% or above will reduce down to 6 MB or so
>
> I have sleepless nights with this so I'm realy seeking information and
> possibilities.
>
> Thanks a lot in advance
> Ole
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palm.com/devzone/mailinglists.html
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html