Ricardo wrote:
How can I read from a specific part of a record?
I have 3 ints in the record. I can read the first one like this:
MemHandle mH = DmQueryRecord(ArchivoBD, 0);
MemPtr mP = MemHandleLock(mH);
MemMove( &int1, mP, 2);
How can I get the other 2? I tried using MemMove( &int2, mP+2, 2);, but it won't work.
It won't work, because you didn't tell the compiler about the element
size your MemPtr points to. What you need is to cast your MemPtr to an
UInt8 pointer or better to an int pointer:
int *mP = (int *) MemHandleLock(mH);
int1 = mp[0];
int2 = mP[1];
int3 = mP[2];
Regards
Henk
--
-------------------------------------------------------------------------
Henk Jonas [EMAIL PROTECTED]
Palm OS ® certified developer
Please contact me, if you need an off-side contract worker.
-------------------------------------------------------------------------
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/