yes, palm compilers align every Int16 or Int32 values to even adress...
there is usually some compiler pragma available to disable it, but then your
program will crash if it will try to access items on non-aligned addresses.

so basically you have to options.
1) leave structure with aligning and write loader for it which will load values
one by one and put them to their places
2) disable aligning and everytime you will have to use 'valueTwo' you would have
to write some code around it (MemMove its content to temporary variable, or read
it byte by byte and combine values together)

John Jenusaitis wrote:
> I have the following structure,
> 
> typedef struct
> {
> UInt32  dWordOne
> UInt16  valueOne
> Char    name[9]
> UInt16  valueTwo
> Char    text
> } MyType
> 
> My question is whether Palm adds a byte padding to fit the structure
> into a certain bounds?  When I cast my record to this structure, the
> data that follows the fixed length string (name[9]), is off by one byte.
>  It appears that an extra byte is being added, following the string.
> Does anyone know if this is correct and a way to handle the issue?
> 
> Thanks
> John
> 

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to