Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

Passing Command Line Arguments in Debud Using Immediate Window

$
0
0
I have a small project which received two command line arguments when it's called. But there is something not right with the code and it's crashing with this very strange error message. So I am attempting to launch the Main sub in Module1 using the imediate window to see what's up. I tried this:

Code:

Main C:\Inetpub\maildrop\Drop1\6b08c16101cdc68800000006.eml APS
and it tells me the Method arguments must be enclosed in paranthesis, so I added parenthesis like this:

Code:

Main (C:\Inetpub\maildrop\Drop1\6b08c16101cdc68800000006.eml APS)
and it tells me ')' expected....so I then did this:

Code:

Main '(C:\Inetpub\maildrop\Drop1\6b08c16101cdc68800000006.eml APS)'
Oh boy...the program then tried to run but during the break I opened the watch window to check the values for the arguments and all it's telling me is

Quote:

my.Application.CommandLineArgs(0) {"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"} System.ArgumentOutOfRangeException
my.Application.CommandLineArgs(1) {"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"} System.ArgumentOutOfRangeException
So what's the key to passing command line arguments through the imediate window? I can do it from the command line but get the same error message.

Quote:

P9 : pszqoadhx1u5zahbhohghldgiy4qixhx

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>