Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. 'Author:Jeremy Wong
  2. 'Date: November 21, 2014
  3. 'Purpose: To create a vowel counter application
  4. Option Explicit
  5.  
  6. Private Sub cmdCount_Click()
  7. picOutput.Cls
  8. Dim strInput As String
  9. Dim intVowels As Integer
  10. intVowels = 0
  11. strInput = txtPhrase.Text
  12. If optYAsVowel.Value = True Then
  13. If InStr(strInput, "a") > 0 Then
  14. Do
  15. If Mid(strInput, 1, 1) = "a" Then
  16. intVowels = intVowels + 1
  17. strInput = Mid(strInput, 2)
  18. Else
  19. strInput = Mid(strInput, 2)
  20. End If
  21. Loop Until Len(strInput) = 0
  22. End If
  23. strInput = txtPhrase.Text
  24. If InStr(strInput, "e") > 0 Then
  25. Do
  26. If Mid(strInput, 1, 1) = "e" Then
  27. intVowels = intVowels + 1
  28. strInput = Mid(strInput, 2)
  29. Else
  30. strInput = Mid(strInput, 2)
  31. End If
  32. Loop Until Len(strInput) = 0
  33. End If
  34. strInput = txtPhrase.Text
  35. If InStr(strInput, "i") > 0 Then
  36. Do
  37. If Mid(strInput, 1, 1) = "i" Then
  38. intVowels = intVowels + 1
  39. strInput = Mid(strInput, 2)
  40. Else
  41. strInput = Mid(strInput, 2)
  42. End If
  43. Loop Until Len(strInput) = 0
  44. End If
  45. strInput = txtPhrase.Text
  46. If InStr(strInput, "o") > 0 Then
  47. Do
  48. If Mid(strInput, 1, 1) = "o" Then
  49. intVowels = intVowels + 1
  50. strInput = Mid(strInput, 2)
  51. Else
  52. strInput = Mid(strInput, 2)
  53. End If
  54. Loop Until Len(strInput) = 0
  55. End If
  56. strInput = txtPhrase.Text
  57. If InStr(strInput, "u") > 0 Then
  58. Do
  59. If Mid(strInput, 1, 1) = "u" Then
  60. intVowels = intVowels + 1
  61. strInput = Mid(strInput, 2)
  62. Else
  63. strInput = Mid(strInput, 2)
  64. End If
  65. Loop Until Len(strInput) = 0
  66. End If
  67. If InStr(strInput, "y") > 0 Then
  68. Do
  69. If Mid(strInput, 1, 1) = "y" Then
  70. intVowels = intVowels + 1
  71. strInput = Mid(strInput, 2)
  72. Else
  73. strInput = Mid(strInput, 2)
  74. End If
  75. Loop Until Len(strInput) = 0
  76. End If
  77. Else
  78. If InStr(strInput, "a") > 0 Then
  79. Do
  80. If Mid(strInput, 1, 1) = "a" Then
  81. intVowels = intVowels + 1
  82. strInput = Mid(strInput, 2)
  83. Else
  84. strInput = Mid(strInput, 2)
  85. End If
  86. Loop Until Len(strInput) = 0
  87. End If
  88. strInput = txtPhrase.Text
  89. If InStr(strInput, "e") > 0 Then
  90. Do
  91. If Mid(strInput, 1, 1) = "e" Then
  92. intVowels = intVowels + 1
  93. strInput = Mid(strInput, 2)
  94. Else
  95. strInput = Mid(strInput, 2)
  96. End If
  97. Loop Until Len(strInput) = 0
  98. End If
  99. strInput = txtPhrase.Text
  100. If InStr(strInput, "i") > 0 Then
  101. Do
  102. If Mid(strInput, 1, 1) = "i" Then
  103. intVowels = intVowels + 1
  104. strInput = Mid(strInput, 2)
  105. Else
  106. strInput = Mid(strInput, 2)
  107. End If
  108. Loop Until Len(strInput) = 0
  109. End If
  110. strInput = txtPhrase.Text
  111. If InStr(strInput, "o") > 0 Then
  112. Do
  113. If Mid(strInput, 1, 1) = "o" Then
  114. intVowels = intVowels + 1
  115. strInput = Mid(strInput, 2)
  116. Else
  117. strInput = Mid(strInput, 2)
  118. End If
  119. Loop Until Len(strInput) = 0
  120. End If
  121. strInput = txtPhrase.Text
  122. If InStr(strInput, "u") > 0 Then
  123. Do
  124. If Mid(strInput, 1, 1) = "u" Then
  125. intVowels = intVowels + 1
  126. strInput = Mid(strInput, 2)
  127. Else
  128. strInput = Mid(strInput, 2)
  129. End If
  130. Loop Until Len(strInput) = 0
  131. End If
  132. End If
  133. picOutput.Print intVowels
  134. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement