Hi All,
I'm attempting to pack a database record using the
common method. The problem is that my record only
contains strings and any example I can find usually
has ints at the start of the record. I can not seem
to get the pack routine to write the correct data. My
code is below, any help would be greatly appreciated.
Cheers,
Nick
void PackCircuit(CircuitInfo *circuit, MemHandle
circuitDBEntry)
{
UInt16 length = 0;
Char *s;
UInt16 offset = 0;
length = (UInt16) (StrLen(circuit->idname) +
StrLen(circuit->name) + StrLen(circuit->country) +
3);
if (MemHandleResize(circuitDBEntry, length) == 0)
{
s = (Char *) MemHandleLock(circuitDBEntry);
offset = 0;
DmStrCopy(s, offset, circuit->idname);;
offset += (UInt16) sizeof(circuit->idname);
DmStrCopy(s, offset, circuit->name);
offset += (UInt16) StrLen(circuit->name) + 1;
DmStrCopy(s, offset, circuit->country);
offset += (UInt16) StrLen(circuit->country) + 1;
MemHandleUnlock(circuitDBEntry);
}
}
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/