I have this structure:
struct Record {
UInt16 a;
UInt16 b;
UInt8 c;
UInt16 d;
} ixRec;
the value in record field d is 0 at this point:
then I am trying to change field d with DmWrite like this:
UInt16 val = 0;
val = (UInt16)(memP->d + 1);
err = DmWrite(memP,5,&val,2);
now the value at field d is 256 or 0b0000000100000000
when I use:
err = DmWrite(memP,6,&val,2);
I get the correct result, d is now 1 or 0b0000000000000001
>From my record structure, I picked 5 as the byte offset value for DmWrite,
but that doesn't work, so I have to pick offset 6, which is the low byte
of the UInt16 field. That seems backwards because I am writing bytes
5 and 6 starting at 6, can someone explain or am I missing something
else ?
thanks.
__________________________________________________
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/