Quoting Jyothi ([EMAIL PROTECTED]):

> i have entry field box, i want to convert the the value entried in entry
> field to hexadecimal.
> how to do this.

I've not checked the manual, but I assume

  StrPrintF ( hexstr, "%x", StrAToI ( decimalstr ));

would work in the general case.  I think I'd be tempted to write my
own conversion function unless I was already using StrPrintF elsewhere
though.  Something like:

  hexdigits = "0123456789abcdef";
  v = StrAToI ( decimalstr );
  p = hexstr;
  do {
    *p++ = hexdigits[v & 0x0f];
    v >>= 4;
  } while ( v );
  *p-- = 0;
  q = hexstr;
  while ( q < p ) {
    c = *q;
    *q++ = *p;
    *p-- = c;
  }

modulo all the necessary sanity checks and bugs introduced by me writing
code off the top of my head...

James

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