From: <[EMAIL PROTECTED]>
> get a C programming book and learn C.

probably the best thing he could do, yes.

> From: Conrad Spiteri [mailto:[EMAIL PROTECTED]
> Hi Alvin,
> When I used your suggested code i.e.
> 
>   value[0] = hexdigits[y[0] >> 4];
>   value[1] = hexdigits[y[0] & 0xf];
> 
> I got non hex values like _(underscore) and 'P'. I
> have also noted that this only happens where the data
> is greater than 0x00FF.
> How can I seperate the upper and lowwer byte.

hexdigits[(y[0] & 0xf0) >> 4];
hexdigits[(y[0] & 0x0f)];

remember, the hexdigits is an array of 16 char's. this means
your index should be between 0..15, while the second case was
correct, in the event that y[0] was > 0x00ff, it wouldn't 
create a value between 0..15. thats why you should & with
0xf0 to mask out the bits you want from the data before you
do a shift. you could have also shifted, then masked with 0x0f

these are elementary C programming issues however, and you should
not be asking such questions here. lets try and keep the discussion
specific to palmos development :)

---
Aaron Ardiri                           [EMAIL PROTECTED]
CEO - CTO                                              +46 70 656 1143
Mobile Wizardry                         http://www.mobilewizardry.com/

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

Reply via email to