If anyone could shead some light on this, I'd greatly appreciate it...

I'm trying to read an array of UInt16's at the end of my records.  There is
a struct and a sereies of packed strings before the beginning of the array.

With help from others I now have this code in place.

_____________________________

UInt16 ProfileGlobal[1000];
unsigned char *profileP;

    RecH = DmQueryRecord(DBRef,RowID);
   profileP =  MemHandleLock(RecH);
   profileP += Tally; // now pointing at beginning of UInt16 array.
   for(i = 0; i <= ProfileLength; i++)
   {
        MemMove(&ProfileGlobal[i],profileP,sizeof(UInt16));
        profileP += 2;

   }
   MemHandleUnlock(RecH);

____________________________

With this code, I can read the first TWO values correctly, but the rest are
not being read right..

Does anyone know why this is happening?  I'm incrementing the char* by 2
since a UInt16 is 2 bytes long, but it seems to somehow be getting
dis-aligned.

Thanks in advance.

Jim








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

Reply via email to