I believe there is a problem in your code and not the sign of the number.

Your value, 1953785202 = 0x74746572, has no relation to any part of -11, signed or 
unsigned.
I would guesss this number is garbage, meaning either your read command simply failed 
(leaving your variable unititialized), or you
read the wrong part of your DB.

And Int32 written = Int32 read, but you have to read and write the correct bytes. :)

Some code snippets would help.
- Jeff

Bert Ruiterkamp wrote:

> Hi all,
>
> I am storing negative Int32 values in a database.
> When checking the stored value  for -11 I find
> FF FF FF F5 which looks OK to me. (Hi bit set
> so a negative value).
>
> But when I read the value back into a Int32 variable
> I get the value 1953785202
>
> Can anyone help me with these two questions:
> Why does the signed int not return a negative value?
> And in what way can I get the correct negative value?
>
> Thanks
> Bert Ruiterkamp
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see 
>http://www.palmos.com/dev/tech/support/forums/


-- 
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