Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Author:Jeremy Wong
- 'Date: November 21, 2014
- 'Purpose: To create a vowel counter application
- Option Explicit
- Private Sub cmdCount_Click()
- picOutput.Cls
- Dim strInput As String
- Dim intVowels As Integer
- intVowels = 0
- strInput = txtPhrase.Text
- If optYAsVowel.Value = True Then
- If InStr(strInput, "a") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "a" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- strInput = txtPhrase.Text
- If InStr(strInput, "e") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "e" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- strInput = txtPhrase.Text
- If InStr(strInput, "i") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "i" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- strInput = txtPhrase.Text
- If InStr(strInput, "o") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "o" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- strInput = txtPhrase.Text
- If InStr(strInput, "u") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "u" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- If InStr(strInput, "y") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "y" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- Else
- If InStr(strInput, "a") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "a" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- strInput = txtPhrase.Text
- If InStr(strInput, "e") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "e" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- strInput = txtPhrase.Text
- If InStr(strInput, "i") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "i" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- strInput = txtPhrase.Text
- If InStr(strInput, "o") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "o" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- strInput = txtPhrase.Text
- If InStr(strInput, "u") > 0 Then
- Do
- If Mid(strInput, 1, 1) = "u" Then
- intVowels = intVowels + 1
- strInput = Mid(strInput, 2)
- Else
- strInput = Mid(strInput, 2)
- End If
- Loop Until Len(strInput) = 0
- End If
- End If
- picOutput.Print intVowels
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement