Hi all,

I'm writing a ceaser-cipher type program and I'm just making a sample of the first part of it as a test to make sure I know what I'm doing before I start on the main program. Just a quick question to ask: How do you change a character value?

For example, consider the following code:

Code:
Private Sub Enc_Click()
Dim a As String
Dim b As String

a = TextIn.Text
b = Mid$(a, 1, 1)

End Sub
In this sample example, I make the string "a" contain the content of a textbox, which will contain the plaintext that needs encrypting. the string "b" then takes the first character of that textbox (I'll also need to figure out how to make it go through some kind of loop until it reaches the end of the textbox content stored in "a", but that's a question for later).

What I need to know is, how can I "bit-shift" that value ("b")? I tried some fiddling around with "Chr$()" and "KeyAscii", but with not much success. Obviously I could create 26 variables and have each one store a bit-shifted value for the letters 1-26, and then make a big-ass "If-else" statement, but that would make the code ugly and wouldn't be efficient. Surely there is some command like "b.AsciiCharacterValue = b.AsciiCharacterValue +1" or something? (Of course, it would be more like "+ x", where x would contain a randomly generated number from 1-25 to use as the bitshift).

Thanks!