Page 1 of 1

PostPosted: Sun Jan 12, 2003 7:42 pm
by troyk9
Is there a built in function to return the ascii value of a character?
I want to limit the types of characters that can be typed/used in a string to ascii 065-090.
For the moment I am using a while loop to check for a space before the first word, but there are other errors a use may type
ex. a period.
This may not be very easily seen on the palm screen, but it's a nightmare when using databases and memos.
If there isn't - I would like to suggest something like strasc() or whatever to return the ascii value so I can use a simple if statement to eliminate a range of unwanted characters.

PostPosted: Sun Jan 12, 2003 8:25 pm
by samps
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"> Is there a built in function to return the ascii value of a character?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">




ascii_value=(int)(char)"a";


Samps

PostPosted: Sun Jan 12, 2003 8:50 pm
by troyk9
Thanks SAmps - that was fast!
Where did you find that? I thought I looked all over the help topics
Well anyway it works GREAT!!

PostPosted: Mon Jan 13, 2003 1:56 am
by samps
I searched. For 'ascii' and 'character' in all forums.

I remembered that the discussion had been brought up before, and had a vague remembrance of the manual not covering it to the extent that wasa needed.
It might be obvious to hardened C-coders, but I'm not one of those.


cheers
Samps