?
Solved

Command Line Parameters in VB5

Posted on 1997-12-17
2
Medium Priority
?
353 Views
Last Modified: 2008-03-17
How can I process command line parameters in VB5?
0
Comment
Question by:lankford
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
dirtdart earned 200 total points
ID: 1445706
In your startup Subroutine (Sub Main or Form_Load) you need to process the built in variable Command or Command$ (either one does the same thing).  This will pass all the command line parameters entered when that program started into the program.
0
 
LVL 5

Expert Comment

by:dirtdart
ID: 1445707
Oops.  I guess I should tell you that it's just a string variable, so you can treat it like any other string variable.  For example, if you're expecting a Command line parameter of "jrf" then you can do this:

If Command = "jrf" Then
 'Do whatever....
End if


You can use multipule command line parameters by separating them with a comma (or whatever else you want, just as long as you remember what it is).  Just like this:

Dim x As Integer
Dim cmdOne As String
Dim cndTwo As String

x = InStr(Command, ",")
cmdOne = Left(Command, x - 1)
cmdTwo = Right(Command, x)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question