D
david
When I build this code in Visual Studio 2005 I get and error saying: " 'Sub Main' was not found in 'ConsoleApplication2.Module1' "
" . Sub Main is there. In the online help is said is either missing or not in the correct location. I moved it to the top and it made no difference.
Imports System
Module SpillTheBeans
Private name As String
Private age As Integer
Public Sub DisplayData()
Console.WriteLine("{0} is {1}", name, age)
End Sub
Public Function GetDescription(ByVal age As Integer) As String
If age < 18 Then
Return "Minor"
Else
Return "Adult"
End If
End Function
Public Sub main()
name = "Betty"
age = 24
DisplayData()
Dim Descr As String = GetDescription(age)
Console.WriteLine("{0} is a {1}", name, Descr)
End Sub
End Module
" . Sub Main is there. In the online help is said is either missing or not in the correct location. I moved it to the top and it made no difference.
Imports System
Module SpillTheBeans
Private name As String
Private age As Integer
Public Sub DisplayData()
Console.WriteLine("{0} is {1}", name, age)
End Sub
Public Function GetDescription(ByVal age As Integer) As String
If age < 18 Then
Return "Minor"
Else
Return "Adult"
End If
End Function
Public Sub main()
name = "Betty"
age = 24
DisplayData()
Dim Descr As String = GetDescription(age)
Console.WriteLine("{0} is a {1}", name, Descr)
End Sub
End Module