"johnnyG" <jo*****@discussions.microsoft.com> schrieb:
Since Main() is a subroutine in VB.NET console apps and not a function, is
there a way to return a value to a script ro other "caller" for a VB.NET
console .exe?
\\\
Public Module Program
Public Function Main(ByVal Args() As String) As Integer
For Each Arg As String In Args
MsgBox(Arg)
Next Arg
Application.Run(New MainForm())
If...Then
Return 0
Else
Return 1
...
End If
End Function
End Module
///
Select 'Sub Main' as startup object in the project properties.
Alternatively you can use 'Application.Exit(<exit code>)' or set
'Environment.ExitCode' to the exit code.
Note that the IDE won't show the correct exit code when debugging.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>