Hi Dev,
You can convert the String to UInt and back to String using the
functions
StrAToI - string to integer
StrIToA - Integer to String
Example code:
char * intext ="123";
char * restext;
UInt16 val;
val=StrAToI(intext); /* String to UInt16*/
val=val+2; /* process the value*/
restext=MemPtrNew(10); /* Memory to store the result*/
StrIToA(restext,val); /* UInt16 to String*/
Here I am storing the result in a memory location(restext). Result
string will be "125".
Thanks,
Manikumar K
--------------------------------------------------------------------
Developers' Nation
You've got the questions; we've got the answers.
Visit Us At :http://www.devnation.net for Palm Developer Support
--------------------------------------------------------------------
--- In [EMAIL PROTECTED], "Dev " <[EMAIL PROTECTED]> wrote:
>
>
> Hi Friends,
>
>
> I have a problem with performing calculations in my application. I
want to retrieve a field (String) and convert into UInt type. And
then on that converted value perform some simple calculation. and
finally convert that UInt type to String and display in my report.
How do I go about doing this? Plz if possible, provide a code snippet
which performs this conversion. I'm a newbie to Palm. I also am
storing my data ie a Record in database as a String as I'm storing
all the individual fields, seperated by a '\0' and then clubbing them
together into a String which is saved as a Record. I initially had
lot of trouble Saving/Retrieving Records with multiple fields maybe
due to lack of simple examples. So, plz let me know if there r any
other simple ways out for that too.
>
> But, by priority I need a solution to the Conversion problem.
>
> Thanx for reading this long mail ;-)
>
>
> Thanx in advance for any possible answers
>
> :-))
>
> Dev
>
>
> _____________________________________________________
> Chat with your friends as soon as they come online. Get Rediff Bol
at
> http://bol.rediff.com
>
>
>
>
>
> --
> For information on using the Palm Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/