Yes, I can calculate the length of the record up to the beginning of the UInt16 array, but my problem is moving the pointer from the beginning of the record to that position.
If my struct is 40 bytes long and the total of all the packed strings is 91, the I need to move 131 bytes into the record. But since a UInt16 is 2 bytes long, it seems I can only move it in increments of 2.
ie: arrayP += 65; This would move it 130 bytes, but I would still be off by one byte..
It is unwise to have an array of UInt16's starting at an unaligned address, as the 68K can't read greater-than-byte sized items from odd addresses.
If you can control the generation of those records, I'd either make sure the UInt16 array was at the front of the record with the strings following, or I would add a padding byte to the end of the strings if needed to properly align the UInt16 array.
If you still want access, use a cast to turn your pointer into a char pointer, then add the offset, then cast it back to a UInt16 pointer. You'll have to use MemMove or some similar call to read the values, however, since just dereferencing an off UInt16 pointer will crash the device.
--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
