Page 1 of 1

Changing letters help ASAP!

Posted: Sun Feb 01, 2004 6:36 pm
by Anonymous
i need to make a program that when the user enters a it turns into b and so on. i know the code is chr(ord("a")+1) to change from a to b but what do i do for all the alphabets?
I have this so far:

var letter : string

loop
put "Enter the code:" ..
get letter
if letter = "a" then
put chr (ord ("a") + 1)
end if
end loop


Archived topic from Iceteks, old topic ID:1991, old post ID:16373

Changing letters help ASAP!

Posted: Mon Feb 02, 2004 6:31 pm
by Red Squirrel
I don't know turing, but I assume this is based on the ascii table, so it should be +1 for all characters, and +32 to make it capital (or I think it's -32, forget if the caps come first or not)

So the string ABCDEF would be turned to BCDEFG if you do +1.

Archived topic from Iceteks, old topic ID:1991, old post ID:16440