Solved

Command Line Parameters in VB5

Posted on 1997-12-17
2
344 Views
Last Modified: 2008-03-17
How can I process command line parameters in VB5?
0
Comment
Question by:lankford
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
dirtdart earned 50 total points
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now