It is not called "sprintf" since not all the format tags are supported. To
do what you want, this is what I suggest.
void us2hexstr(char *pHex, unsigned short i)
{
char buffer[16];
StrPrintF(buffer, "%x", i);
unsigned short len = StrLen(buffer);
if(len == 1)
{ StrPrintF(pHex, "0x0%s", buffer); } // fill in a zero
else if(len == 2)
{ StrPrintF(pHex, "0x%s", buffer); } // just copy over
else
{ StrPrintF(pHex, "0x%s", &buffer[1]); } // truncate
}
Enjoy!
Steve
>From: "Essell" <[EMAIL PROTECTED]>
>Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
>To: "Palm Developer Forum" <[EMAIL PROTECTED]>
>Subject: StrPrintF for the PalmOS .. ?
>Date: Mon, 16 Jul 2001 17:42:47 -0700
>
>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 ..
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
>please see http://www.palmos.com/dev/tech/support/forums/
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/