Sorry about the previous post. I work with VB6 and .Net so I get them mixed up sometimes but with the for loop add -1 after the word.count because .Net is zero based. It would be better to use the foreach loop because it works great with array and you don't have to know how many elements are in your array, it just counts them.
On Sep 22, 8:53 pm, Jai <[EMAIL PROTECTED]> wrote: > Sorry if this posted twice. My daughter was playing on here when I > turned away for a moment. > > anyway, > > I am writing a program that requests a sentence from the user one word > at a time. Im then storing that word in an array and creating another > array to reverse the sentence to see if it's a palindrome. > > Public Class Palindrome > Dim word(99), revWord(99) As String > Dim counter As Integer 'counts words > > Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles btnAdd.Click > 'add word to array > word(counter) = txtWord.Text > word(counter + 1) = txtWord.Text 'store word > revWord(99 - counter) = word(counter) 'reverse elements > counter += 1 > End Sub > > Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e > As System.EventArgs) Handles btnCheck.Click > > End Sub > End Class > > At this point Im not even sure that what I have is right. I dont see > anything in my text book about comparing the elements, and I was > unable to locate anything that helped on a basic google search. Do I > have to loop this to keep adding the words entered into the word(99) > array? And how would I compare the elements? what kind of procedures > would you suggest? Mind you, This is advanced VB but it is not > rediculously genius VB - and this in an online course, Im basically > teaching myself with the help of peers like you. > > Learning from my last post, Im here to learn not to argue. So please > provide honest feedback and help, and if I didnt provide enough > information for your help I'll be happy to let you know what you need > to let me tap those brains of yours. THANKS! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://cm.megasolutions.net/forums/default.aspx -~----------~----~----~----~------~----~------~--~---
