I tried the optional way of reversing an array given on pgs. 133 - 134 and it gives me the same array "(0)" four times.
Here is the code for the button:
Code:
Private Sub btnReverseMethod1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReverseMethod1.Click
For intIndex As Integer = strSkills.GetUpperBound(0) To 0 Step -1
'Add the array item(s) to the list
lstSkills.Items.Add(strSkills(0))
Next
End Sub
Here is the code for the Array at the form level:
Code:
Public Class Form1
'Declare form level array
Private strSkills(3) As String
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Polulate the Skills Array
strSkills(0) = "Listen"
strSkills(1) = "Talk"
strSkills(2) = "Type"
strSkills(3) = "E-mail"
End Sub
When I run the project and click on the button I get "Listen" on the list four times (My wife would probably say it's trying to tell me something).
Thanks,
Tek
edited to have code stand out