|
-
Aug 31st, 2000, 04:12 PM
#1
Thread Starter
Addicted Member
I am trying to create an application the would respond to 'switches'. At run time if I run: 'MyApp /a' would execute something different from 'MyApp /b'.
Obviously, this can be done (an please forgive my lack of technical terms...), but I have no idea how.
Anybody knows ?
Thanks.
-
Aug 31st, 2000, 04:17 PM
#2
If you use the Command function it will return all arguments passed to the application.
Code:
Private Sub Form_Load()
Select Case LCase$(Command)
Case "/a"
'do whatever
Case "/b"
'do something else
End Select
End Sub
Good luck!
-
Aug 31st, 2000, 04:21 PM
#3
Monday Morning Lunatic
That works until the end-user puts too many arguments on. You need to use Split() on Command, so that you get a list of all the arguments.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 1st, 2000, 06:13 AM
#4
Thread Starter
Addicted Member
It works great ! Thanks...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|