ack, my email didn't catch up ;-0

You can get the ASCII value of a 'letter' but using....

Int x = 'a';

So you could write a function that walks through the string and adds up the
values. I don't know offhand of a function that does this already though
there may be one.


Int16 GetStringValue(Char* string)
{
    Int16   i,len, total = 0;

    len = StrLen(string);

    for(i = 0; i < len; i++)
    {
        total += string[i];

    }

    return total;
}

-- 
Matt Disher
[EMAIL PROTECTED]


> From: "Carmen Sandiego" <[EMAIL PROTECTED]>
> Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Date: Tue, 26 Mar 2002 17:54:41 -0600
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Subject: Re: StrAToI
> 
> Try a string that reads like a number?
> 
> Well, it works if I only use numbers, but is there a way to convert a string
> (alpha characters) to an integer?
> 
> Thanx!
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe, please
> see http://www.palmos.com/dev/support/forums/
> 


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to