Look-up 'bitwise operators' (or 'binary operators') in a c book,
particularly 'bitwise and'. Both x and 0x00FF are patterns of bits, and
the '&' operator performs a logical 'and' comparison between the two
(between each bit pair). For instance (pseudo-code warning):
00110101 & 10011011 = 00010001
If you don't also know, the '>>' operator is also a bitwise operator and
it's reference shouldn't be far off from wherever you find documentation
on '&'.
Or perhaps you know all this and you're just confused because it sort of
looks like the code below is trying to get the pointer to '0x00FF'.
-----Original Message-----
From: Phillip Streck [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 18, 2001 10:50 AM
To: Palm Developer Forum
Subject: Re: MemMove
what does &0x00FF do.. excuse my ignorance.
Philip Streck
Akron General Medical Center
Information Systems
>>> "Dave Lippincott" <[EMAIL PROTECTED]> 05/18/01 01:22PM >>>
or
ULong x = value;
UShort a,b,c,d
a = (UShort)(x &0x00FF)
b = (UShort)((x>>8)&0x00FF)
c = (UShort)((x>>16)&0x00FF)
d = (UShort)((x>>24)&0x00FF)
----- Original Message -----
From: "Phillip Streck" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, May 18, 2001 1:10 PM
Subject: MemMove
> Ok, i'm not if this would work so let me know.
>
> I need to separate a ULong into 4 UShorts so...
>
> ULong x = value;
>
> UShort a, b, c, d ;
>
> MemMove ( a, x, 2 );
> MemMove ( b, x, 2 );
> MemMove ( c, x, 2 );
> MemMove ( d, x, 2 );
>
> Make sense?
>
> thanks,
>
>
>
> Philip Streck
> Akron General Medical Center
> Information Systems
>
>
> --
> 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/
--
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/