Yes you most certainly do need a loop and you would use counter as your
index for the loop so do something like
for counter = 0 To word.count
you have to initialize your array
Dim array As Integer( ) = {}
and you need to add another loop to count down using a decrementing index
like counter-- or counter -1
Hope this help.
My syntax may be off a little because sometimes I mix up VB and C# syntax
On Mon, Sep 22, 2008 at 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
-~----------~----~----~----~------~----~------~--~---