"Daniel B. Sigurgeirsson" wrote:
> 
> I need to move a block of data that's in a database record.  So let's say I
> have a record with 20 bytes and I want to move the last 15 bytes to the
> beginning of the record, i.e. remove the first 5 bytes.  Could I do:
> 
> // Error checking removed for clarity:
> VoidHand hHandle = DmGetRecord( m_hDatabase, nIndex );
> Byte* pData = reinterpret_cast< Byte*>( MemHandleLock( hHandle ) );
> DmWrite( pData, 0, pData + 5, 15 );
> MemHandleUnlock( hHandle );
> DmReleaseRecord( hHandle );
> 
> ????
> 
> or would it blow up in my face?
> Just wanted to check if anyone has tried something similar...

You might want to take a look at using DmResizeRecord() in order to
shrink the record, but otherwise I think you're on the right track.

-- 
Tony

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to