Sub Main()
Console.WriteLine("check")
Console.Read()
End Sub
Why does Sub Main () need them? How do they apply to this procedure? .WriteLine("") here i am adding a value. Console.Read() is this holding the value "check" to show on console? Why why are they here. I know all you experts think this is a dumb question, however i can not wrap my head around it help! To me these are boxes that hold or pass a procedure value. Is sub main a container holding the code the uses enters? If so, why is it that when a form button is used it is full? But here a VB default unused and empty? Seems to me with no event values it should not be there....?????
Parenthesis are required when they are required, and optional when they are optional. In the case of empty parameter/argument lists parenthesis are "just for show".
A Sub Procedure can be declared as
Sub Main()
orSub Main
- the parenthesis are optional when there are no parameters. Likewise, procedures/functions can be invoked without parenthesis if (and only if) no arguments are supplied.In the above, the definitions of
A
and invocations ofA
are equivalent as the parenthesis are optional in these cases.