Aaron Ardiri wrote:
> On 11/22/05, Dirk Bridgedale <[EMAIL PROTECTED]> wrote:
> 
>>I'm having a problem writing a float data type to a database using DmWrite:
>>
>> char *s
>>
>> DmWrite(s, offset, &data->maxTemp, sizeof(data->maxTemp));
>> offset += sizeof(data->maxTemp);
>>
>> There are other writes before and after the floats. Anything before the
>> floats is ok. Iv'e tried moving things around and found the problem follows
>> the floats.
> 
> 
> what problems are you getting? is DmWrite failing? are you getting a
> soft reset? need more information. a float should be a 2-byte object. a
> double is 4-bytes..
> 
> if you have *that* much problem, how about doing this:
> 
>   DmWrite(s, offset, (UInt16 *)&data->maxTemp, sizeof(UInt16));
> 
> i would check that a float is 2 bytes and a  double is 4 bytes first tho.
> reading and writing 2 bytes should always be the same.
> 
> --
> // Aaron Ardiri
> 

Hm,

aren't floats normally 4 byte and double 8 ?

Juergen

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

Reply via email to