![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2005
Location: Charleston, SC
Posts: 11
Rep Power: 0
![]() |
pig latin exercise - I'm stuck
half way down i am getting an exception error and can't figure out, mind and eyes are numb....
Public Class MainForm Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click Me.Close() End Sub Private Sub xConvertButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xConvertButton.Click ' displays the pig latin form of a word Dim originalWord As String Dim pigLatin As String originalWord = Me.xWordTextBox.Text If originalWord.Substring(0, 1).ToUpper Like "[AEIOU]" Then ' if the word begins with a vowel, add "-way" to the end of the word pigLatin = originalWord & "-way" Else Dim isVowelOrY As Boolean 'Dim indexNum As Integer 'Dim word As String Dim length As Integer Do pigLatin = originalWord.Substring(0, 1) originalWord = originalWord.Remove(0, 1) length = originalWord.Length Loop Until originalWord.Substring(0, 1) Like "[AEIOU]" If originalWord.Substring(0, 1) Like "[AEIOU]" Then originalWord = originalWord & "ay" Me.Label1.Text = "This word in pig latin is " & originalWord.ToLower & "." End If If Not isVowelOrY Then ' if the word does not contain a vowel or the letter y, ' add "-way" to the end of the word pigLatin = originalWord & "-way" Else ' if the word does not begin with a vowel or the letter y, but it contains ' a vowel or the letter y, add a dash to the end of the word, then ' continue moving the first character to the end of the word until ' end of the word End If End If 'display pig Latin form of the word Me.xPigLatinLabel.Text = pigLatin Me.xWordTextBox.Focus() End Sub End Class |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
I'll be a monkey's oinkle. You didn't read the "How to Post a Question" thread, did you? Shamey, shamey, shamey.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Newbie
Join Date: May 2005
Location: Charleston, SC
Posts: 11
Rep Power: 0
![]() |
thanks for your assistance
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Thank you for acting like an entitled brat. It made my day.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Programming Guru
![]() ![]() ![]() |
Your code is already hard to read as it is... maybe because its in VB, or maybe because you forgot to use code tags. :/. Repost with code tags and post the exact error. My eyes go numb looking at what you sent so far.
Also, for a bit more of an insight on this, look at the other thread you made.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Latin word for english word "and" | bigguy | Coder's Corner Lounge | 14 | May 31st, 2007 10:39 PM |
| Exercise C++ Exercise taken from AP Computer Science 1995 Exam, Free-response in C++. | pr0gm3r | C++ | 4 | Jul 31st, 2005 2:58 PM |
| Having trouble with an exercise in the C book. | linuxpimp20 | C | 6 | Jul 6th, 2005 7:22 AM |
| Multiple http-requests are stuck | MereMortal | C++ | 0 | May 4th, 2005 3:08 AM |