I think it works for the "a" vowel, but the others does not work...
Please help! Thanks:
Option Explicit 'Strxex
Private strTxtInput As String
Private intVowelsCountA As Integer
Private intVowelsCountE As Integer
Private intVowelsCountI As Integer
Private intVowelsCountO As Integer
Private intVowelsCountU As Integer
Private intTotalVowels As Integer
Private strA As String
Private intI As Integer
Private Sub cmdCount_Click()
strTxtInput = txtInput.Text
For intI = 1 To Len(strTxtInput)
If Mid$(strTxtInput, intI, 1) = "a" Then
intVowelsCountA = intVowelsCountA + 1
ElseIf Mid$(strTxtInput, intI, 1) = "e" Then
intVowelsCountA = intVowelsCountE + 1
ElseIf Mid$(strTxtInput, intI, 1) = "i" Then
intVowelsCountA = intVowelsCountI + 1
ElseIf Mid$(strTxtInput, intI, 1) = "o" Then
intVowelsCountA = intVowelsCountO + 1
ElseIf Mid$(strTxtInput, intI, 1) = "u" Then
intVowelsCountA = intVowelsCountU + 1
End If
Next
intTotalVowels = intVowelsCountA + intVowelsCountE + intVowelsCountI + intVowelsCountO + intVowelsCountU
lblOutput.Caption = intTotalVowels
End Sub
Private Sub cmdDone_Click()
Unload Me
End Sub

New Topic/Question
Reply



MultiQuote









|