TheJkWhoSaysNi
One of Freddy's beloved
- Joined
- Dec 23, 2003
- Messages
- 187
Very.
This is just silly, I have to write a ceasar cipher. I've done the hard part. It works perfectly.
Unless I try to clear the text box the text is going to before I put something into it!
It works great without the "Cipher.Text = "" " at the beginning but obviously it adds the text onto whatever is already there.
Anyway, I digress. Does anyone know how to fix this problem?
This is just silly, I have to write a ceasar cipher. I've done the hard part. It works perfectly.
Unless I try to clear the text box the text is going to before I put something into it!
Code:
Cipher.Text = "" ' This is the problem.
For i = 1 To Len(PlainText.Text)
Letter = Mid$(PlainText.Text, i, 1)
IntLetter = Asc(Letter)
If IntLetter >= 65 And IntLetter <= 122 Then
If IntLetter >= 65 And IntLetter <= 90 Then
Uppercase = True
Else: Uppercase = False
End If
End If
IntLetter = IntLetter + Shift.Value
If Uppercase = True Then
If IntLetter > 90 Then
IntLetter = IntLetter - 26
End If
End If
If Uppercase = False Then
If IntLetter > 122 Then
IntLetter = IntLetter - 26
End If
End If
Cipher.Text = Cipher.Text + Chr(IntLetter)
Next i
It works great without the "Cipher.Text = "" " at the beginning but obviously it adds the text onto whatever is already there.
Anyway, I digress. Does anyone know how to fix this problem?