|
-
Jun 29th, 2000, 01:02 PM
#1
Thread Starter
New Member
is it possible to send any arguments to a standard exe prepared using vb? if yes, how to use these arguments in the startup modules or forms of the exe?
-
Jun 29th, 2000, 01:14 PM
#2
Lively Member
Yes it is possible.
Use the Command() function to get the argument of your program
Code:
dim CmdLine as string
CmdLine = Command()
' Treatment of the CmdLine
...
-
Jun 29th, 2000, 01:58 PM
#3
PowerPoster
Let said you wish your VB program to accept an command line "/%1 /config"
then all you need is put this under the Sub Main() or Form_Load() procedure.
Code:
Option Explicit
Private MyCmdLine As String
Public Sub Main()
MyCmdLine = Command()
If MyCmdLine = "/%1 /config" then
'Do whatever you've plan.
Else
'Do whatever you don't want your program do.
End If
End Sub
Or....
Private Sub Form_Load()
MyCmdLine = Command()
If MyCmdLine = "/%1 /config" then
'Do whatever you've plan.
Else
'Do whatever you don't want your program do.
End If
End Sub
-
Jun 30th, 2000, 07:43 PM
#4
transcendental analytic
Like operator is fast and easy if you want to put flags in your command line:
Code:
Public Sub Main()
MyCmdLine = Command()
If MyCmdLine like "*/a*" then 'Do what you what
If MyCmdLine like "*/b*" then 'Do what you what
If MyCmdLine like "*/c*" then 'Do what you what
If MyCmdLine like "*/d*" then 'Do what you what
If MyCmdLine like "*/e*" then 'Do what you what
End Sub
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|