>
> hi guys ..
>
> i've tried something like this & it doesn't work on the palm ..
> StrPrintF(&testMe[x],"%02x",&testString[y]) ..
>
> "%02x" seems to be the same as "%x" with this function .. but i really
need
> "%02x" .. can someone please tell me how this is done .. or if it cannot
be
> done .. any other way i could acheive the same result ..
>
>
> thanx a whole lot ..
>
>
Why does everyone seem to have a problem with *general purpose* library
functions that don't perform in the *explict* way that they would like. For
such a simple case as above, time would be better spent in writing a small
(probably faster) custom function to do the same job (it would also serve as
a good exercise in programming for anyone found lacking in the requist
skills *grin*) rather than post and wait for someone else to dish the goods
and hold their hand a little
eg
void HexToStr_02(char *out, uint in)
{
static char hs[] = "0123456789ABCDEF";
*out++ = hs[(in >> 8) & 0xF];
*out++ = hs[in & 0xF];
*out=0;
}
That way you wont have the extra overhead of the sprintf function parsing
va_args and performing all sorts of stack jiggery pokery and parsing format
strings - eek. (hell - it could even be made into a macro!)
FWIW - I've only been subscribed to this list for a couple of weeks and this
is my first post. I've had a couple of newbie questions anwsered on other
lists (thanks for the help az) but I do find it frustrating having to wade
through pages of crap in the digest to find the juicy bits - especially when
most questions *CAN* be anwsered by searching the KB or using the find
feature (the button with the binoculars on it) in acrobat to search the
SDK's, or by doing some coding , (this also had the added side effect that
you may just learn something and become a better programmer!)
Kudos to the guys who post source code that doesn't work (at least they
tried!)
Oh and thanks to everyone who posted code on how to read the owners name
from the system prefs - I need to do this soon and I WAS going to search the
docs, but you've saved me some time - cheers!
Oopps - just fell off my soapbox 8-)
Jon (mr Flamebait)...
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/