Changing letters help ASAP!

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
Anonymous

Changing letters help ASAP!

Post 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
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Changing letters help ASAP!

Post 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
Honk if you love Jesus, text if you want to meet Him!
Locked