Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Character to Ascii : Possible? 1

Status
Not open for further replies.

sylve

Programmer
Jan 18, 2005
58
CA
Ok the situation is i have a string that looks like this:
"AA". I have a button that's suppose to increment this to "AB". When it reaches "AZ", it should turn into "BA" and so forth.

My idea was to use ascii codes 65 to 90 (A to Z) and increment the push it back into the string with chr().

Um, but how do i extract the ascii code of the character selected?
 
couple of thoughts:

why don't you include the ascii code in the value of the button so that you can pick it up when the button is pressed.

to do what you precisely wanted you would need to split the input (AB becomes A and B) and then use the ord() function.

 
Thank you! The ord() function is exactly what i was looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top