Good day!
Faced a problem, wrote a method, but how now to call it?
Let me explain there is a method, it performs for example the following code:
Sub start()
MsgBox("123")
End Sub
It seems to me somehow it is necessary to call this method, but how? please tell me ))
if you run it like this, it gives an error:
Invoke code : Error compiling code
error BC30289: Statement cannot appear within a method body. End of method assumed. At line 3
error BC30429: 'End Sub' must be preceded by a matching 'Sub'. At line 9
Thank you, with this I understood everything, functions, methods are declared through lambda expressions, but the question arises next, how to declare a class?
I need this code to work:
Dim people As New List(Of Person)(3)
people.Add(New Person() With {.Name = "Tom"})
people.Add(New Person() With {.Name = "Bill"})
For Each p As Person In people
MsgBox(p.Name)
Next
Console.ReadLine()
End Sub
Class Person
Public Property Name() As String
End Class
Public Property Name () As A String
End Class