Results 1 to 2 of 2

Thread: Passing arguments to a VB executable.

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Posts
    38

    Question

    Is it possible to create an exe in Visual Basic that allows you to pass parameters as well? If so, can somebody please give me some sample code for determining the values of these parameters from within the application?
    For example, in the following statement:

    Call SampleApp.exe Parm1, parm2

    how can I determine the values of parm1 and parm2 from within SampleApp.exe?

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Yep. The Command function returns any paramaters that were passed in the command line.

    Code:
    Private Sub Form_Load()
        Dim strTemp As String
        Dim strParams() As String
        
        strTemp = Command
        'split string up on commas.
        strParams = Split(strTemp, ",")
        
    End Sub
    Iain, thats with an i by the way!

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