Results 1 to 2 of 2

Thread: [RESOLVED] Passing Command Line Arguments in Debud Using Immediate Window

  1. #1

    Thread Starter
    Hyperactive Member Vladamir's Avatar
    Join Date
    Feb 2012
    Location
    Miami, FL
    Posts
    486

    Resolved [RESOLVED] Passing Command Line Arguments in Debud Using Immediate Window

    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

    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.

    P9 : pszqoadhx1u5zahbhohghldgiy4qixhx

  2. #2

    Thread Starter
    Hyperactive Member Vladamir's Avatar
    Join Date
    Feb 2012
    Location
    Miami, FL
    Posts
    486

    Re: Passing Command Line Arguments in Debud Using Immediate Window

    Okay, once again the solution reveals itself. The command line arguments can be set in the Debug window of the Project Properties. Stumbled upon this one after I posted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width