Results 1 to 3 of 3

Thread: Determine if individual letters are in a textbox

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    35
    Hi, Im new to this and wanted to know: I have a standard exe with two text boxes and one command button, how would I code that to determine if certain letters are in one textbox so they can be converted to say a specific number in the second text box, almost like encryption. Thanks

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    You can use this as a starting point
    Code:
    Private Sub cmdConvert_Click()
    
        Dim intIndex As Integer
        
        For intIndex = 1 To Len(txtInput)
            Select Case UCase(Mid$(txtInput, intIndex, 1))
                Case "A"
                    txtOutput = txtOutput & "3"
                Case "B"
                    txtOutput = txtOutput & "7"
                Case "C"
                    txtOutput = txtOutput & "9"
                Case Else
                    txtOutput = txtOutput & "?"
            End Select
        Next
    
    End Sub

  3. #3
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357
    Check out This Post for my simple encryption example, as well as some other ideas.
    ~seaweed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width