If I understand you right, I can have a fixed length structure where
int, string[22], string2[23] are fixed sizes and I can then store
shorter strings (say 10 and 12 respectively) in this structure and by
using PandRecord and UnpackRecord to save this in a compacted record,
with basically the unused 12 and 11 bytes removed.

AND I don't have to worry about a record being 49 bytes one time and
40 bytes the next time it is updated.

Where is this (these functions) documented?  Where can I find out more
about this?  I have checked the API docs and don't see anything.  Maybe
I'm not looking in the right place.

I'm sure what I have suggested is oversimplified.



On Mon, 17 May 1999, Bob Ebert wrote:

> At 1:46 AM -0700 5/17/99, Mike Davis wrote:
> >I don't see a cooresponding DmRead type function.  What is
> >the best way to read one variable at a time from a DB record?
> 
> As Keith says, you don't need DmRead.
> 
> I think you might find it useful to adopt a PackRecord/UnpackRecord
> approach, much like the built in apps use.
> 
> That is, when you "open" a record, call UnpackRecord which essentially
> copies it into a fixed-length structure in the dynamic heap.  Then you do
> as much editing as you want in this somewhat easier to use structure.
> 
> When you're done editing, you call PackRecord once, and it's this routine
> which is responsible for determining the minimum size for the saved data,
> resizing the data manager handle, and writing the changed data back into
> the database.
> 
> This does a reasonable job of isolating the code that knows about the
> database format from the code that does the editing, and give you a nice
> bottleneck for load/save operations, which may save you time later when
> you're debugging.
> 
>                               --Bob
> 
> 
> 
> 

----------------------------------------------------
Shoot-to-Win

Protect the 2nd Amendment
----------------------------------------------------

Reply via email to