bayouprophet@yahoo.com
Member
- Joined
- Jan 13, 2009
- Messages
- 5
- Programming Experience
- Beginner
Why is visual 8.0 is giving my the following error when running the following code.
Option Explicit On
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Example 6 - For each w/array
Dim myArray() As String = ("Bob","Beth","Conrad","Grant")
Dim person As String
For Each person In myArray()
MessageBox.Show(person)
Next
End Sub
End Class
Error 1 ')' expected. C:\Users\bayouprophet\Documents\Visual Studio 2008\Projects\Lesson05\Lesson05\Form1.vb 8 41 Lesson05
Error 2 Name 'myArray' is not declared. C:\Users\bayouprophet\Documents\Visual Studio 2008\Projects\Lesson05\Lesson05\Form1.vb 11 28 Lesson05
Option Explicit On
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Example 6 - For each w/array
Dim myArray() As String = ("Bob","Beth","Conrad","Grant")
Dim person As String
For Each person In myArray()
MessageBox.Show(person)
Next
End Sub
End Class
Error 1 ')' expected. C:\Users\bayouprophet\Documents\Visual Studio 2008\Projects\Lesson05\Lesson05\Form1.vb 8 41 Lesson05
Error 2 Name 'myArray' is not declared. C:\Users\bayouprophet\Documents\Visual Studio 2008\Projects\Lesson05\Lesson05\Form1.vb 11 28 Lesson05