RSS Forums RSS
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 6746 | Replies: 0
Reply
Join Date: Jan 2004
Posts: 1
Reputation: lawdie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lawdie lawdie is offline Offline
Newbie Poster

Caesar cipher problem with CHR(32)

  #1  
Jan 24th, 2004
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

AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:04 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC