Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Line Switch From VB 1

Status
Not open for further replies.

boggg1

Programmer
Oct 17, 2002
102
EU
I would like two different shortcuts on my desktop to run the same VB program but one shortcut to disable one part of the program. In my mind I am thinking of the equivalent of a command line switch but then I am a very old programer. Any ideas how to do this in VB ?

Boggg1
[bigglasses]
 
Use a command line switch just as you thought.

The command line is available via the Command function which returns the arguments as a single string so you'll have to parse it yourself.
 
In you form load or sub main, which ever happens first when your application is ran, test for the parameter like this:

If Command = strSomeValue Then
MsgBox "Has Parameter"
Else
MsgBox "No Parameter"
End If

Then all you need to do is in one of the shortcuts add the parameter to the Target.

"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
What took you so long ?. I mean... 10 minutes where were you ?

Thanks guys - prompt service as always. Why didn't my books tell me about this command - hmmmmm.

Boggg1
[bigglasses]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top