| | |
Caesar cipher problem with CHR(32)
![]() |
•
•
Join Date: Jan 2004
Posts: 1
Reputation:
Solved Threads: 0
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
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
- Help needed with Caesar Cipher (C++)
- Need help with Caesar Cipher program (Java)
- New to java, Caesar Cipher question. (Java)
- Help With Caesar Cipher/Shift (Pascal and Delphi)
- Need help with caesar cipher (Python)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: More newbie problems - VBScript and Env variables
- Next Thread: passing arrays in visual basic
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





