That�s unbelievable! In Kernighan & Ritchie ANSI C there is a function
long strtol(const char *, char **, int base)
which converts an ASCII string in ANY base to long, and this poor API
provides no way of doing this using StrAToI nor using StrPrintF!
I�m using SDK 4.0!!!
Any ideas?
Thanks
Leonardo Holanda
--- In [EMAIL PROTECTED], The Armadillo With The Mask <[EMAIL PROTECTED]>
wrote:
> Scott Herman wrote:
>
> > At 11:11 AM 7/24/01 -0700, The Armadillo With The Mask wrote:
> >
> >> [EMAIL PROTECTED] wrote:
> >>
> >>
> >>> Hello all!
> >>
> >> Hi Leonardo!
> >>
> >>
> >>> Is there any function to convert a Char* that contains a Hexadecimal
ASCII to an Int32? There is a function
> >
> >> There's nothing directly in the API to do it, but why not use StrPrintF
to format the string the way you want?
> >> Something like:
> >> StrPrintF(MyLongIntStr,"%ld",MyHexStr);
> >> MyLongInt=StrAToI(MyLongIntStr);
> >>
> >> Theres more info about formatting strings with Str{V}PrintF on page 678
of the 3.5 API reference.
> >
> >
> >
> > Umm... Sorry to bust yer bubble, but "%ld" means that the argument is a
long integer,
> > StrPrintF does NOT do string translation.
> >
>
> Okay, I had to try this out just because I know it works in other
> UNIX/Linux tools that do (s)printf() style formatting and the Palm API
> docs certainly make it look like it should work.
>
> Unfortunately, you're right. I stand corrected.Hrmmm, well, there's a
> ASCII->Hex converter in the old PalmOS GCC Programming Tutorial. You
> might be able to rip some useful bits from there.
>
> 'dillo
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/