943,567 Members | Top Members by Rank

Ad:
Jan 24th, 2004
0

Caesar cipher problem with CHR(32)

Expand Post »
Hi all



I’ve been trying ever combination to get this code finished. Basically I can get the cipher to work okay. But the ‘space’ character returns as U, I’m trying to figure out how.

Do I need another loop? Or am I on the wrong track and should scrape this approach?



Thanks, Lawdie

Private Sub cmdRandy_Click()
Dim count As Integer, free As Integer
Dim original As String, phoenix As String, build As String

original = txtMatrix.Text
count = Len(txtMatrix.Text)
For free = 1 To count
phoenix = Asc(Mid(original, free, 1))
If phoenix = Chr(32) Then
phoenix = phoenix + Chr(32)

Else: phoenix = phoenix + Asc(5)

phoenix = Chr(phoenix)

End If

build = build + phoenix

Next free

MsgBox build, vbInformation, "Result"
txtMatrix.Text = ""
txtMatrix.SetFocus

End Sub

Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lawdie is offline Offline
1 posts
since Jan 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: More newbie problems - VBScript and Env variables
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: passing arrays in visual basic





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC