>>>>> "MD" == Mike Davis <[EMAIL PROTECTED]> writes:
MD> How is this possible?  Why does the value for the Long (x) get
MD> reset to zero?

Simple.

StrItoA() can't handle "long long", and you are treating values in
big endian format. that's why values became 0.


StrItoA() can treat only variables of "Long" which is "long"
actually, and is 32bits long( or 4 bytes long ).And this value is
given as second parameter.

On other hand, variable x, which is long long, uses 64bit long( or 8
bytes long ).

Since Palm is big endian device, when you put 
        0x123456789abcdef0ULL
values to x, then image of byte array will become
        +0 +1 +2 +3 +4 +5 +6 +7
        12 34 56 78 9a bc de f0

If you analyze this byte array as if it is 32bit long fixed point
values of big endian, what you'll get is

        0x12345678

latter "9abcdef0" parts being cut off.


If you gave a value of very small number(I mean values below 4G),
then you'll get 0 for this program. And since this value is second
parameter, latter 4 bytes( I mean 9a bc de f0 part ) will do no harm
against entire parameter. If it was of 1st parameter, then things
will differ.



regards,

Reply via email to