E Ed Willis Oct 7, 2003 #1 How do you read parameters that are entered for a console application myprog /r how can I get the /r in the Sub Main? Thanks.
How do you read parameters that are entered for a console application myprog /r how can I get the /r in the Sub Main? Thanks.
H Herfried K. Wagner [MVP] Oct 7, 2003 #2 Ed Willis said: How do you read parameters that are entered for a console application myprog /r how can I get the /r in the Sub Main? Click to expand... \\\ Public Sub Main(ByVal astrCmdLineArgs() As String) Dim i As Integer For i = 0 To astrCmdLineArgs.Length - 1 Console.WriteLine(astrCmdLineArgs(i)) Next i End Sub ///
Ed Willis said: How do you read parameters that are entered for a console application myprog /r how can I get the /r in the Sub Main? Click to expand... \\\ Public Sub Main(ByVal astrCmdLineArgs() As String) Dim i As Integer For i = 0 To astrCmdLineArgs.Length - 1 Console.WriteLine(astrCmdLineArgs(i)) Next i End Sub ///
T Tom Spink Oct 7, 2003 #3 Hi Ed, Declare your sub main as follows: Public Sub Main(Arguments() As String) For Each strArgument As String In Arguments Console.WriteLine(strArgument) Next End Sub That will print each argument to the console. -- HTH, -- Tom Spink, Über Geek Please respond to the newsgroup, so all can benefit " System.Reflection Master " ==== Converting to 2002 ==== Remove inline declarations
Hi Ed, Declare your sub main as follows: Public Sub Main(Arguments() As String) For Each strArgument As String In Arguments Console.WriteLine(strArgument) Next End Sub That will print each argument to the console. -- HTH, -- Tom Spink, Über Geek Please respond to the newsgroup, so all can benefit " System.Reflection Master " ==== Converting to 2002 ==== Remove inline declarations