A program that will return a value

Bryan_James

Member
Joined
Apr 3, 2015
Messages
5
Location
Manila, Philippines, Asia, Earth
Programming Experience
Beginner
Hi!
I've been wondering, can the Main method return something? All this time I coded Main as a Sub and not a Function.
In C, I can return an integer value at the end of main. Is this possible in VB.NET?

I tried:
VB.NET:
Module Module1

    Function Main(ByVal args() As String)


        Return 0
    End Function


End Module

But this doesn't work. Thanks in advance!
 
This should work:

Function Main(ByVal args() As String) As Integer
    ...
    Return 0
End Function


But the real question is how are you verifying that it does or doesn't work?
 
Back
Top